grpc 1.43.1 → 1.48.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 +488 -338
- data/include/grpc/compression.h +1 -1
- data/include/grpc/event_engine/event_engine.h +64 -20
- data/include/grpc/event_engine/memory_allocator.h +0 -15
- data/include/grpc/event_engine/port.h +1 -1
- data/include/grpc/event_engine/slice.h +286 -0
- data/include/grpc/event_engine/slice_buffer.h +118 -0
- data/include/grpc/grpc.h +43 -17
- data/include/grpc/grpc_posix.h +20 -19
- data/include/grpc/grpc_security.h +47 -50
- data/include/grpc/impl/codegen/compression_types.h +2 -3
- data/include/grpc/impl/codegen/connectivity_state.h +2 -1
- data/include/grpc/impl/codegen/gpr_types.h +2 -1
- data/include/grpc/impl/codegen/grpc_types.h +26 -22
- data/include/grpc/impl/codegen/port_platform.h +107 -40
- data/include/grpc/impl/codegen/slice.h +5 -2
- data/include/grpc/slice.h +0 -11
- data/src/core/ext/filters/census/grpc_context.cc +3 -0
- data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +309 -0
- data/src/core/ext/filters/channel_idle/channel_idle_filter.h +141 -0
- data/src/core/ext/filters/{client_idle → channel_idle}/idle_filter_state.cc +1 -1
- data/src/core/ext/filters/{client_idle → channel_idle}/idle_filter_state.h +7 -5
- data/src/core/ext/filters/client_channel/backend_metric.cc +20 -15
- data/src/core/ext/filters/client_channel/backend_metric.h +19 -9
- data/src/core/ext/filters/client_channel/backup_poller.cc +20 -14
- data/src/core/ext/filters/client_channel/backup_poller.h +2 -4
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +48 -26
- data/src/core/ext/filters/client_channel/client_channel.cc +413 -301
- data/src/core/ext/filters/client_channel/client_channel.h +83 -45
- data/src/core/ext/filters/client_channel/client_channel_channelz.cc +3 -5
- data/src/core/ext/filters/client_channel/client_channel_channelz.h +12 -2
- data/src/core/ext/filters/client_channel/client_channel_factory.cc +5 -0
- data/src/core/ext/filters/client_channel/client_channel_factory.h +8 -0
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +8 -23
- data/src/core/ext/filters/client_channel/config_selector.cc +1 -0
- data/src/core/ext/filters/client_channel/config_selector.h +12 -10
- data/src/core/ext/filters/client_channel/connector.h +10 -4
- data/src/core/ext/filters/client_channel/dynamic_filters.cc +20 -8
- data/src/core/ext/filters/client_channel/dynamic_filters.h +14 -4
- data/src/core/ext/filters/client_channel/global_subchannel_pool.cc +4 -22
- data/src/core/ext/filters/client_channel/global_subchannel_pool.h +6 -15
- data/src/core/ext/filters/client_channel/health/health_check_client.cc +140 -583
- data/src/core/ext/filters/client_channel/health/health_check_client.h +26 -160
- data/src/core/ext/filters/client_channel/http_proxy.cc +98 -112
- data/src/core/ext/filters/client_channel/http_proxy.h +20 -0
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc +10 -5
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +7 -5
- data/src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h +49 -0
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +12 -0
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h +5 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +15 -12
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h +1 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +227 -137
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +0 -7
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc +4 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +6 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +25 -16
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +10 -7
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +407 -0
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.h +57 -0
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.cc +1036 -0
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +54 -0
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +196 -176
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +364 -224
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +381 -233
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +6 -1
- data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +253 -175
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +261 -234
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +133 -120
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +155 -105
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +172 -84
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds.h +7 -1
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +99 -46
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +55 -30
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +355 -394
- data/src/core/ext/filters/client_channel/lb_policy.cc +19 -16
- data/src/core/ext/filters/client_channel/lb_policy.h +37 -34
- data/src/core/ext/filters/client_channel/lb_policy_factory.h +2 -0
- data/src/core/ext/filters/client_channel/lb_policy_registry.cc +11 -6
- data/src/core/ext/filters/client_channel/lb_policy_registry.h +6 -1
- data/src/core/ext/filters/client_channel/local_subchannel_pool.cc +4 -0
- data/src/core/ext/filters/client_channel/local_subchannel_pool.h +1 -0
- data/src/core/ext/filters/client_channel/proxy_mapper.h +1 -1
- data/src/core/ext/filters/client_channel/proxy_mapper_registry.cc +1 -0
- data/src/core/ext/filters/client_channel/proxy_mapper_registry.h +5 -0
- data/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc +36 -22
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +383 -318
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +30 -13
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +29 -23
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +29 -44
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +172 -240
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +38 -36
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +3 -2
- data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc +2 -0
- data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h +2 -1
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +123 -254
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +37 -37
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +7 -3
- data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +144 -77
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +213 -0
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +113 -0
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +56 -50
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +368 -167
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h +3 -1
- data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +19 -28
- data/src/core/ext/filters/client_channel/resolver_result_parsing.h +22 -10
- data/src/core/ext/filters/client_channel/retry_filter.cc +322 -201
- data/src/core/ext/filters/client_channel/retry_filter.h +1 -0
- data/src/core/ext/filters/client_channel/retry_service_config.cc +27 -30
- data/src/core/ext/filters/client_channel/retry_service_config.h +28 -13
- data/src/core/ext/filters/client_channel/retry_throttle.cc +10 -31
- data/src/core/ext/filters/client_channel/retry_throttle.h +18 -6
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +30 -11
- data/src/core/ext/filters/client_channel/subchannel.cc +227 -235
- data/src/core/ext/filters/client_channel/subchannel.h +84 -40
- data/src/core/ext/filters/client_channel/subchannel_interface.h +51 -41
- data/src/core/ext/filters/client_channel/subchannel_interface_internal.h +38 -0
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.cc +12 -2
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.h +6 -3
- data/src/core/ext/filters/client_channel/subchannel_stream_client.cc +473 -0
- data/src/core/ext/filters/client_channel/subchannel_stream_client.h +222 -0
- data/src/core/ext/filters/deadline/deadline_filter.cc +31 -21
- data/src/core/ext/filters/deadline/deadline_filter.h +11 -3
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +173 -402
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +31 -3
- data/src/core/ext/filters/fault_injection/service_config_parser.cc +18 -17
- data/src/core/ext/filters/fault_injection/service_config_parser.h +27 -7
- data/src/core/ext/filters/http/client/http_client_filter.cc +108 -535
- data/src/core/ext/filters/http/client/http_client_filter.h +35 -5
- data/src/core/ext/filters/http/client_authority_filter.cc +44 -112
- data/src/core/ext/filters/http/client_authority_filter.h +28 -6
- data/src/core/ext/filters/http/http_filters_plugin.cc +33 -24
- data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +101 -320
- data/src/core/ext/filters/http/message_compress/message_compress_filter.h +1 -2
- data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +59 -133
- data/src/core/ext/filters/http/message_compress/message_decompress_filter.h +1 -0
- data/src/core/ext/filters/http/server/http_server_filter.cc +100 -458
- data/src/core/ext/filters/http/server/http_server_filter.h +37 -3
- data/src/core/ext/filters/message_size/message_size_filter.cc +66 -70
- data/src/core/ext/filters/message_size/message_size_filter.h +25 -5
- data/src/core/ext/filters/rbac/rbac_filter.cc +174 -0
- data/src/core/ext/filters/rbac/rbac_filter.h +84 -0
- data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +617 -0
- data/src/core/ext/filters/rbac/rbac_service_config_parser.h +87 -0
- data/src/core/ext/filters/server_config_selector/server_config_selector.cc +3 -8
- data/src/core/ext/filters/server_config_selector/server_config_selector.h +14 -4
- data/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc +97 -199
- data/src/core/ext/filters/server_config_selector/server_config_selector_filter.h +1 -0
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +278 -77
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +9 -7
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +288 -56
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +2 -0
- data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +3 -3
- 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 +512 -710
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +14 -3
- data/src/core/ext/transport/chttp2/transport/context_list.cc +4 -0
- data/src/core/ext/transport/chttp2/transport/context_list.h +4 -1
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +147 -263
- data/src/core/ext/transport/chttp2/transport/flow_control.h +180 -289
- data/src/core/ext/transport/chttp2/transport/frame.h +0 -4
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +59 -212
- data/src/core/ext/transport/chttp2/transport/frame_data.h +13 -36
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +3 -0
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +3 -1
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +9 -4
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +3 -0
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +11 -2
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +3 -0
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +12 -42
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +4 -0
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +10 -12
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +3 -0
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +349 -290
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +85 -162
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc +4 -1
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h +5 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +61 -91
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +8 -2
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +146 -37
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +41 -46
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +0 -1
- data/src/core/ext/transport/chttp2/transport/internal.h +41 -153
- data/src/core/ext/transport/chttp2/transport/parsing.cc +87 -51
- data/src/core/ext/transport/chttp2/transport/stream_lists.cc +11 -11
- data/src/core/ext/transport/chttp2/transport/stream_map.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/stream_map.h +1 -0
- data/src/core/ext/transport/chttp2/transport/varint.h +2 -0
- data/src/core/ext/transport/chttp2/transport/writing.cc +135 -157
- data/src/core/ext/transport/inproc/inproc_plugin.cc +0 -5
- data/src/core/ext/transport/inproc/inproc_transport.cc +117 -158
- data/src/core/ext/transport/inproc/inproc_transport.h +3 -4
- data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c +117 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h +482 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c +121 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h +553 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +182 -176
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +1248 -685
- data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c +56 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h +151 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c +62 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h +160 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c +46 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h +124 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c +43 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h +102 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c +43 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h +97 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c +106 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h +605 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c +48 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h +103 -0
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +14 -12
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +49 -16
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +13 -11
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +49 -23
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +98 -96
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +669 -386
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +185 -173
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +1269 -664
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +34 -26
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +200 -91
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +252 -238
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +1670 -827
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +10 -8
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +42 -24
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +49 -27
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +272 -99
- data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c +299 -0
- data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h +1381 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +54 -50
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +354 -190
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +11 -8
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +45 -25
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +157 -154
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +1068 -582
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +87 -42
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +525 -167
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +9 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +38 -24
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +11 -29
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +41 -101
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c +58 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h +151 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +108 -104
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +768 -410
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +115 -84
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +736 -349
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +11 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +57 -31
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +162 -108
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +992 -397
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +8 -6
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +28 -17
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +15 -13
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +83 -49
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +13 -11
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +75 -34
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +15 -13
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +93 -49
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +11 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +46 -26
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +34 -32
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +194 -109
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +51 -48
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +349 -190
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +49 -47
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +357 -188
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +9 -7
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +34 -21
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +72 -61
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +504 -260
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +77 -69
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +560 -301
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +19 -15
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +104 -49
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +12 -10
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +66 -41
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c +53 -0
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h +136 -0
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +58 -55
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +413 -235
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +62 -60
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +406 -237
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +82 -76
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +562 -294
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +37 -31
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +271 -142
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +503 -475
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +3642 -1901
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +25 -19
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +148 -72
- data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c +222 -0
- data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h +1052 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c +44 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h +88 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c +49 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h +103 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +15 -13
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +77 -46
- data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c +52 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h +134 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c +63 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h +250 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c +47 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h +94 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c +69 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h +213 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c +32 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h +42 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c +71 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h +218 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c +54 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h +146 -0
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +8 -6
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +34 -24
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +29 -27
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +188 -113
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +36 -34
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +260 -132
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c +64 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +183 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +16 -14
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +86 -43
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +229 -198
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +1553 -734
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.c +52 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +164 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.c +46 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.h +94 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +3 -1
- 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 +87 -58
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +554 -235
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +26 -24
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +156 -87
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +98 -71
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +622 -263
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c +62 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h +160 -0
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +6 -4
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h +22 -16
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +67 -65
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +474 -256
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +18 -16
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +107 -62
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +51 -49
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +347 -186
- data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c +48 -0
- data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h +112 -0
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +20 -18
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +124 -82
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c +74 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h +214 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +16 -14
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +99 -57
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +10 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +50 -31
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +10 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +48 -27
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +9 -7
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +38 -24
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +21 -19
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +117 -69
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +19 -17
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +123 -65
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +14 -12
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +85 -53
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +23 -21
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +150 -83
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +32 -30
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +230 -146
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +36 -34
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +235 -131
- data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c +66 -0
- data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h +201 -0
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.c +3 -1
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.h +2 -1
- data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c +42 -0
- data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h +139 -0
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +13 -11
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +62 -36
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +19 -17
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +98 -52
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c +26 -0
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h +41 -0
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +10 -8
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +40 -19
- data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c +51 -0
- data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h +127 -0
- data/src/core/ext/upb-generated/google/api/annotations.upb.c +8 -6
- data/src/core/ext/upb-generated/google/api/annotations.upb.h +22 -6
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +109 -103
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +720 -382
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +120 -112
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +795 -402
- data/src/core/ext/upb-generated/google/api/http.upb.c +29 -27
- data/src/core/ext/upb-generated/google/api/http.upb.h +216 -115
- data/src/core/ext/upb-generated/google/api/httpbody.upb.c +46 -0
- data/src/core/ext/upb-generated/google/api/httpbody.upb.h +111 -0
- data/src/core/ext/upb-generated/google/protobuf/any.upb.c +9 -7
- data/src/core/ext/upb-generated/google/protobuf/any.upb.h +38 -22
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +291 -237
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +2076 -1030
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +9 -7
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +36 -20
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +6 -4
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +22 -16
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +31 -29
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +177 -93
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +9 -7
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +36 -20
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +40 -38
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +240 -149
- data/src/core/ext/upb-generated/google/rpc/status.upb.c +11 -9
- data/src/core/ext/upb-generated/google/rpc/status.upb.h +52 -30
- data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c +84 -0
- data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h +319 -0
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +21 -19
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +103 -48
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +102 -96
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +685 -359
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +16 -13
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +76 -41
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +12 -10
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +56 -35
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +57 -55
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +383 -219
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c +22 -20
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h +115 -63
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c +175 -0
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h +764 -0
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +36 -34
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +189 -78
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +14 -12
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +53 -22
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +7 -5
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +15 -6
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +14 -12
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +55 -24
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +13 -11
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +49 -23
- data/src/core/ext/upb-generated/validate/validate.upb.c +339 -312
- data/src/core/ext/upb-generated/validate/validate.upb.h +2726 -1180
- data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c +110 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h +278 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.c +55 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.h +108 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c +38 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h +46 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c +34 -32
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h +171 -80
- data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c +53 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h +99 -0
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +8 -6
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +30 -19
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +18 -16
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +98 -55
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +14 -12
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +53 -30
- data/src/core/ext/upb-generated/xds/core/v3/extension.upb.c +46 -0
- data/src/core/ext/upb-generated/xds/core/v3/extension.upb.h +103 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +12 -10
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +55 -30
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +20 -18
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +130 -70
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +12 -10
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +58 -30
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +23 -21
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +101 -46
- data/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c +47 -0
- data/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.h +109 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c +207 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h +878 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c +52 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h +143 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c +65 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h +218 -0
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +10 -8
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h +42 -24
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c +84 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c +127 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c +14 -12
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h +67 -67
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c +43 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c +53 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c +49 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c +46 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c +46 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c +142 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c +51 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c +8 -6
- data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h +1 -1
- data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c +8 -6
- data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +20 -17
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h +46 -46
- data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +248 -240
- data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h +55 -55
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c +58 -51
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +385 -371
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +76 -76
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c +14 -11
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +23 -16
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c +206 -0
- data/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h +105 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c +15 -13
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h +22 -22
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c +15 -12
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +85 -80
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +73 -73
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +138 -101
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h +26 -16
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c +14 -12
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c +22 -34
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h +4 -9
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c +53 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c +21 -18
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h +43 -43
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +177 -166
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h +30 -25
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c +14 -12
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +250 -221
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h +53 -43
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c +12 -9
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c +14 -11
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c +14 -11
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c +18 -15
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c +13 -11
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c +18 -15
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h +13 -13
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +19 -16
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +19 -19
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c +18 -15
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h +16 -16
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c +14 -11
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +52 -45
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h +19 -19
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +153 -147
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h +22 -22
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c +19 -16
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c +15 -12
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c +69 -0
- data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c +17 -14
- data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h +25 -25
- data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c +17 -14
- data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h +28 -28
- data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c +190 -0
- data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h +70 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +36 -27
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +826 -803
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +160 -160
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c +52 -37
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c +188 -0
- data/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h +85 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c +54 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c +57 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c +15 -12
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c +72 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c +99 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c +52 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c +71 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c +57 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c +75 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c +77 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +15 -11
- data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c +17 -14
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h +16 -16
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +18 -15
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c +59 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +17 -13
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +197 -172
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +63 -58
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c +15 -11
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h +1 -1
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +169 -140
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h +24 -19
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +19 -16
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +217 -199
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h +24 -19
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c +58 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c +14 -11
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +17 -14
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h +22 -22
- data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c +16 -13
- data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c +20 -17
- data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h +16 -16
- data/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c +46 -0
- data/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c +13 -10
- data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h +13 -13
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c +52 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c +15 -12
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c +15 -12
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c +15 -12
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c +15 -12
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +15 -12
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c +15 -12
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c +14 -12
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c +16 -13
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c +13 -10
- data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h +22 -22
- data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c +14 -11
- data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h +16 -16
- data/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c +53 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c +10 -8
- data/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h +1 -1
- data/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c +94 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c +12 -10
- data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c +11 -8
- data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c +38 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c +11 -9
- data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c +57 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h +1 -1
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c +154 -0
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h +95 -0
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c +153 -0
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h +100 -0
- data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c +3 -3
- data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c +39 -0
- data/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c +3 -3
- data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +3 -3
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h +82 -82
- data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c +3 -3
- data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c +3 -3
- data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c +3 -3
- data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h +13 -13
- data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c +3 -3
- data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c +3 -3
- data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h +28 -28
- data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c +4 -4
- data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c +67 -0
- data/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c +99 -0
- data/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h +75 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c +4 -4
- data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c +4 -4
- data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h +1 -1
- data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c +4 -4
- data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c +4 -4
- data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +6 -6
- data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.h +70 -70
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c +63 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c +47 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c +35 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c +4 -4
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h +13 -13
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c +40 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c +7 -7
- data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c +4 -4
- data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c +41 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c +6 -6
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c +6 -6
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c +6 -6
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c +126 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h +80 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c +40 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c +52 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h +4 -4
- data/src/core/ext/xds/certificate_provider_factory.h +6 -1
- data/src/core/ext/xds/certificate_provider_registry.cc +8 -8
- data/src/core/ext/xds/certificate_provider_registry.h +3 -1
- data/src/core/ext/xds/certificate_provider_store.cc +12 -0
- data/src/core/ext/xds/certificate_provider_store.h +18 -0
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +13 -4
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +10 -2
- data/src/core/ext/xds/upb_utils.h +66 -0
- data/src/core/ext/xds/xds_api.cc +376 -3718
- data/src/core/ext/xds/xds_api.h +71 -619
- data/src/core/ext/xds/xds_bootstrap.cc +250 -141
- data/src/core/ext/xds/xds_bootstrap.h +39 -23
- data/src/core/ext/xds/xds_certificate_provider.cc +17 -3
- data/src/core/ext/xds/xds_certificate_provider.h +25 -1
- data/src/core/ext/xds/xds_channel_stack_modifier.cc +24 -18
- data/src/core/ext/xds/xds_channel_stack_modifier.h +9 -4
- data/src/core/ext/xds/xds_client.cc +850 -1160
- data/src/core/ext/xds/xds_client.h +129 -156
- data/src/core/ext/xds/xds_client_stats.cc +18 -19
- data/src/core/ext/xds/xds_client_stats.h +9 -7
- data/src/core/ext/xds/xds_cluster.cc +554 -0
- data/src/core/ext/xds/xds_cluster.h +119 -0
- data/src/core/ext/xds/xds_cluster_specifier_plugin.cc +151 -0
- data/src/core/ext/xds/xds_cluster_specifier_plugin.h +72 -0
- data/src/core/ext/xds/xds_common_types.cc +402 -0
- data/src/core/ext/xds/xds_common_types.h +103 -0
- data/src/core/ext/xds/xds_endpoint.cc +381 -0
- data/src/core/ext/xds/xds_endpoint.h +143 -0
- data/src/core/ext/xds/xds_http_fault_filter.cc +17 -15
- data/src/core/ext/xds/xds_http_fault_filter.h +6 -4
- data/src/core/ext/xds/xds_http_filters.cc +18 -5
- data/src/core/ext/xds/xds_http_filters.h +7 -7
- data/src/core/ext/xds/xds_http_rbac_filter.cc +579 -0
- data/src/core/ext/xds/xds_http_rbac_filter.h +61 -0
- data/src/core/ext/xds/xds_lb_policy_registry.cc +291 -0
- data/src/core/ext/xds/xds_lb_policy_registry.h +72 -0
- data/src/core/ext/xds/xds_listener.cc +1067 -0
- data/src/core/ext/xds/xds_listener.h +229 -0
- data/src/core/ext/{transport/chttp2/transport/hpack_utils.h → xds/xds_resource_type.cc} +12 -9
- data/src/core/ext/xds/xds_resource_type.h +98 -0
- data/src/core/ext/xds/xds_resource_type_impl.h +91 -0
- data/src/core/ext/xds/xds_route_config.cc +1150 -0
- data/src/core/ext/xds/xds_route_config.h +227 -0
- data/src/core/ext/xds/xds_routing.cc +28 -9
- data/src/core/ext/xds/xds_routing.h +15 -7
- data/src/core/ext/xds/xds_server_config_fetcher.cc +234 -129
- data/src/core/lib/address_utils/parse_address.cc +25 -8
- data/src/core/lib/address_utils/parse_address.h +8 -2
- data/src/core/lib/address_utils/sockaddr_utils.cc +82 -51
- data/src/core/lib/address_utils/sockaddr_utils.h +9 -19
- data/src/core/lib/avl/avl.h +71 -6
- data/src/core/lib/backoff/backoff.cc +9 -38
- data/src/core/lib/backoff/backoff.h +12 -12
- data/src/core/lib/channel/call_finalization.h +90 -0
- data/src/core/lib/channel/call_tracer.h +15 -6
- data/src/core/lib/channel/channel_args.cc +202 -45
- data/src/core/lib/channel/channel_args.h +243 -9
- data/src/core/lib/channel/channel_args_preconditioning.cc +6 -10
- data/src/core/lib/channel/channel_args_preconditioning.h +4 -4
- data/src/core/lib/channel/channel_fwd.h +26 -0
- data/src/core/lib/channel/channel_stack.cc +55 -10
- data/src/core/lib/channel/channel_stack.h +83 -14
- data/src/core/lib/channel/channel_stack_builder.cc +19 -276
- data/src/core/lib/channel/channel_stack_builder.h +104 -150
- data/src/core/lib/channel/channel_stack_builder_impl.cc +97 -0
- data/src/core/lib/channel/channel_stack_builder_impl.h +46 -0
- data/src/core/lib/channel/channel_trace.cc +11 -19
- data/src/core/lib/channel/channel_trace.h +6 -3
- data/src/core/lib/channel/channelz.cc +11 -14
- data/src/core/lib/channel/channelz.h +15 -7
- data/src/core/lib/channel/channelz_registry.cc +11 -19
- data/src/core/lib/channel/channelz_registry.h +10 -9
- data/src/core/lib/channel/connected_channel.cc +26 -30
- data/src/core/lib/channel/connected_channel.h +4 -1
- data/src/core/lib/channel/context.h +11 -0
- data/src/core/lib/channel/promise_based_filter.cc +1263 -0
- data/src/core/lib/channel/promise_based_filter.h +572 -0
- data/src/core/lib/channel/status_util.cc +2 -0
- data/src/core/lib/channel/status_util.h +0 -3
- data/src/core/lib/compression/compression.cc +26 -113
- data/src/core/lib/compression/compression_internal.cc +170 -204
- data/src/core/lib/compression/compression_internal.h +68 -72
- data/src/core/lib/compression/message_compress.cc +14 -12
- data/src/core/lib/compression/message_compress.h +4 -5
- data/src/core/lib/config/core_configuration.cc +11 -2
- data/src/core/lib/config/core_configuration.h +41 -1
- data/src/core/lib/debug/stats.cc +9 -9
- data/src/core/lib/debug/stats.h +2 -1
- data/src/core/lib/debug/stats_data.cc +4 -7
- data/src/core/lib/debug/stats_data.h +18 -25
- data/src/core/lib/debug/trace.h +13 -12
- data/src/core/lib/event_engine/channel_args_endpoint_config.cc +4 -2
- data/src/core/lib/event_engine/channel_args_endpoint_config.h +3 -2
- data/src/core/lib/{iomgr/event_engine/resolved_address_internal.h → event_engine/default_event_engine_factory.cc} +10 -12
- data/src/core/lib/event_engine/event_engine.cc +40 -10
- data/src/core/lib/event_engine/event_engine_factory.h +8 -0
- data/src/core/lib/event_engine/handle_containers.h +67 -0
- data/src/core/lib/event_engine/iomgr_engine/iomgr_engine.cc +159 -0
- data/src/core/lib/event_engine/iomgr_engine/iomgr_engine.h +122 -0
- data/src/core/lib/event_engine/iomgr_engine/thread_pool.cc +123 -0
- data/src/core/lib/event_engine/iomgr_engine/thread_pool.h +70 -0
- data/src/core/lib/event_engine/iomgr_engine/time_averaged_stats.cc +62 -0
- data/src/core/lib/event_engine/iomgr_engine/time_averaged_stats.h +81 -0
- data/src/core/lib/event_engine/iomgr_engine/timer.cc +312 -0
- data/src/core/lib/event_engine/iomgr_engine/timer.h +193 -0
- data/src/core/lib/event_engine/iomgr_engine/timer_heap.cc +107 -0
- data/src/core/lib/event_engine/iomgr_engine/timer_heap.h +56 -0
- data/src/core/lib/event_engine/iomgr_engine/timer_manager.cc +254 -0
- data/src/core/lib/event_engine/iomgr_engine/timer_manager.h +111 -0
- data/src/core/lib/event_engine/memory_allocator.cc +20 -16
- data/src/core/lib/{iomgr/event_engine → event_engine}/promise.h +27 -9
- data/src/core/lib/{iomgr/event_engine/resolved_address_internal.cc → event_engine/resolved_address.cc} +13 -13
- data/src/core/lib/event_engine/slice.cc +102 -0
- data/src/core/lib/event_engine/slice_buffer.cc +50 -0
- data/src/core/{ext/filters/max_age/max_age_filter.h → lib/event_engine/trace.cc} +3 -11
- data/src/core/lib/{iomgr/endpoint_pair_event_engine.cc → event_engine/trace.h} +12 -14
- data/src/core/lib/gpr/log.cc +5 -0
- data/src/core/lib/gpr/sync_posix.cc +1 -0
- data/src/core/lib/gpr/time.cc +2 -1
- data/src/core/lib/gpr/time_posix.cc +6 -9
- data/src/core/lib/gpr/time_windows.cc +10 -7
- data/src/core/lib/gpr/tls.h +4 -5
- data/src/core/lib/gpr/useful.h +18 -0
- data/src/core/lib/gprpp/bitset.h +24 -1
- data/src/core/lib/gprpp/chunked_vector.h +49 -3
- data/src/core/lib/gprpp/construct_destruct.h +1 -0
- data/src/core/lib/gprpp/cpp_impl_of.h +4 -0
- data/src/core/lib/gprpp/debug_location.h +2 -0
- data/src/core/lib/gprpp/dual_ref_counted.h +1 -4
- data/src/core/lib/gprpp/examine_stack.h +0 -1
- data/src/core/lib/gprpp/fork.cc +3 -6
- data/src/core/lib/gprpp/global_config.h +2 -4
- data/src/core/lib/gprpp/global_config_env.cc +3 -2
- data/src/core/lib/gprpp/global_config_env.h +3 -1
- data/src/core/lib/gprpp/global_config_generic.h +0 -4
- data/src/core/lib/gprpp/host_port.cc +2 -0
- data/src/core/lib/gprpp/manual_constructor.h +0 -68
- data/src/core/lib/gprpp/match.h +75 -0
- data/src/core/lib/gprpp/memory.h +1 -5
- data/src/core/lib/gprpp/orphanable.h +1 -4
- data/src/core/lib/gprpp/overload.h +59 -0
- data/src/core/lib/gprpp/ref_counted.h +3 -3
- data/src/core/lib/gprpp/ref_counted_ptr.h +1 -1
- data/src/core/lib/gprpp/single_set_ptr.h +87 -0
- data/src/core/lib/gprpp/stat.h +0 -2
- data/src/core/lib/gprpp/stat_posix.cc +7 -2
- data/src/core/lib/gprpp/status_helper.cc +74 -48
- data/src/core/lib/gprpp/status_helper.h +10 -19
- data/src/core/lib/gprpp/sync.h +3 -1
- data/src/core/lib/gprpp/table.h +21 -0
- data/src/core/lib/gprpp/thd.h +2 -5
- data/src/core/lib/gprpp/thd_posix.cc +4 -2
- data/src/core/lib/gprpp/thd_windows.cc +2 -0
- data/src/core/lib/gprpp/time.cc +214 -0
- data/src/core/lib/gprpp/time.h +301 -0
- data/src/core/lib/gprpp/time_util.cc +4 -0
- data/src/core/lib/gprpp/time_util.h +1 -1
- data/src/core/lib/gprpp/unique_type_name.h +104 -0
- data/src/core/lib/http/format_request.cc +62 -29
- data/src/core/lib/http/format_request.h +10 -7
- data/src/core/lib/http/httpcli.cc +325 -244
- data/src/core/lib/http/httpcli.h +232 -91
- data/src/core/lib/http/httpcli_security_connector.cc +79 -79
- data/src/core/lib/http/httpcli_ssl_credentials.h +39 -0
- data/src/core/lib/http/parser.cc +85 -15
- data/src/core/lib/http/parser.h +18 -2
- data/src/core/lib/iomgr/buffer_list.h +5 -5
- data/src/core/lib/iomgr/call_combiner.cc +17 -6
- data/src/core/lib/iomgr/closure.h +29 -9
- data/src/core/lib/iomgr/combiner.cc +25 -3
- data/src/core/lib/iomgr/endpoint.cc +4 -4
- data/src/core/lib/iomgr/endpoint.h +7 -5
- data/src/core/lib/iomgr/endpoint_cfstream.cc +9 -6
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +2 -1
- data/src/core/lib/iomgr/error.cc +24 -19
- data/src/core/lib/iomgr/error.h +9 -7
- data/src/core/lib/iomgr/ev_apple.cc +6 -5
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +65 -25
- data/src/core/lib/iomgr/ev_epoll1_linux.h +1 -1
- data/src/core/lib/iomgr/ev_poll_posix.cc +84 -59
- data/src/core/lib/iomgr/ev_poll_posix.h +2 -2
- data/src/core/lib/iomgr/ev_posix.cc +58 -100
- data/src/core/lib/iomgr/ev_posix.h +6 -4
- data/src/core/lib/iomgr/exec_ctx.cc +25 -97
- data/src/core/lib/iomgr/exec_ctx.h +8 -25
- data/src/core/lib/iomgr/executor.cc +10 -1
- data/src/core/lib/iomgr/fork_posix.cc +1 -0
- data/src/core/lib/iomgr/internal_errqueue.cc +38 -47
- data/src/core/lib/iomgr/internal_errqueue.h +1 -6
- data/src/core/lib/iomgr/iocp_windows.cc +9 -9
- data/src/core/lib/iomgr/iocp_windows.h +1 -1
- data/src/core/lib/iomgr/iomgr.cc +7 -1
- data/src/core/lib/iomgr/{event_engine/pollset.h → iomgr_fwd.h} +9 -9
- data/src/core/lib/iomgr/iomgr_posix.cc +3 -2
- data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +3 -2
- data/src/core/lib/iomgr/iomgr_windows.cc +2 -2
- data/src/core/lib/iomgr/load_file.cc +1 -1
- data/src/core/lib/iomgr/polling_entity.h +6 -0
- data/src/core/lib/iomgr/pollset.cc +1 -1
- data/src/core/lib/iomgr/pollset.h +4 -4
- data/src/core/lib/iomgr/pollset_set.h +1 -2
- data/src/core/lib/iomgr/pollset_windows.cc +2 -2
- data/src/core/lib/iomgr/port.h +26 -12
- data/src/core/lib/iomgr/resolve_address.cc +12 -23
- data/src/core/lib/iomgr/resolve_address.h +56 -46
- data/src/core/lib/iomgr/resolve_address_impl.h +58 -0
- data/src/core/lib/iomgr/resolve_address_posix.cc +76 -66
- data/src/core/lib/iomgr/resolve_address_posix.h +50 -0
- data/src/core/lib/iomgr/resolve_address_windows.cc +87 -75
- data/src/core/lib/iomgr/resolve_address_windows.h +50 -0
- data/src/core/{ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc → lib/iomgr/resolved_address.h} +21 -10
- data/src/core/lib/iomgr/sockaddr.h +2 -3
- data/src/core/lib/iomgr/sockaddr_posix.h +2 -0
- data/src/core/lib/iomgr/sockaddr_utils_posix.cc +62 -0
- data/src/core/lib/iomgr/sockaddr_windows.h +2 -0
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +3 -19
- data/src/core/lib/iomgr/tcp_client.cc +12 -7
- data/src/core/lib/iomgr/tcp_client.h +24 -12
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +24 -10
- data/src/core/lib/iomgr/tcp_client_posix.cc +157 -32
- data/src/core/lib/iomgr/tcp_client_posix.h +2 -2
- data/src/core/lib/iomgr/tcp_client_windows.cc +27 -16
- data/src/core/lib/iomgr/tcp_posix.cc +167 -64
- data/src/core/lib/iomgr/tcp_server_posix.cc +57 -34
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +42 -38
- data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +10 -6
- data/src/core/lib/iomgr/tcp_server_windows.cc +20 -12
- data/src/core/lib/iomgr/tcp_windows.cc +29 -19
- data/src/core/lib/iomgr/timer.cc +2 -2
- data/src/core/lib/iomgr/timer.h +11 -6
- data/src/core/lib/iomgr/timer_generic.cc +96 -77
- data/src/core/lib/iomgr/timer_manager.cc +15 -14
- data/src/core/lib/iomgr/unix_sockets_posix.cc +22 -34
- data/src/core/lib/iomgr/unix_sockets_posix.h +4 -7
- data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +6 -15
- data/src/core/lib/iomgr/wakeup_fd_pipe.cc +2 -2
- data/src/core/lib/iomgr/wakeup_fd_posix.cc +15 -12
- data/src/core/lib/iomgr/wakeup_fd_posix.h +0 -2
- data/src/core/lib/iomgr/work_serializer.cc +15 -10
- data/src/core/lib/iomgr/work_serializer.h +2 -3
- data/src/core/lib/json/json.h +1 -2
- data/src/core/lib/json/json_reader.cc +9 -1
- data/src/core/lib/json/json_util.cc +11 -4
- data/src/core/lib/json/json_util.h +15 -6
- data/src/core/lib/json/json_writer.cc +6 -1
- data/src/core/lib/matchers/matchers.cc +7 -4
- data/src/core/lib/matchers/matchers.h +2 -0
- data/src/core/lib/promise/activity.cc +15 -10
- data/src/core/lib/promise/activity.h +192 -157
- data/src/core/lib/promise/arena_promise.h +198 -0
- data/src/core/lib/promise/call_push_pull.h +148 -0
- data/src/core/lib/promise/context.h +1 -1
- data/src/core/lib/promise/detail/basic_seq.h +94 -5
- data/src/core/lib/promise/detail/promise_factory.h +1 -2
- data/src/core/lib/promise/detail/status.h +6 -0
- data/src/core/lib/promise/intra_activity_waiter.h +49 -0
- data/src/core/lib/promise/latch.h +103 -0
- data/src/core/lib/promise/loop.h +36 -8
- data/src/core/lib/promise/poll.h +6 -0
- data/src/core/lib/promise/promise.h +96 -0
- data/src/core/lib/promise/race.h +0 -1
- data/src/core/lib/promise/seq.h +19 -3
- data/src/core/lib/promise/sleep.cc +81 -0
- data/src/core/lib/promise/sleep.h +76 -0
- data/src/core/lib/promise/try_seq.h +157 -0
- data/src/core/{ext/filters/client_channel → lib/resolver}/resolver.cc +22 -25
- data/src/core/{ext/filters/client_channel → lib/resolver}/resolver.h +46 -44
- data/src/core/{ext/filters/client_channel → lib/resolver}/resolver_factory.h +36 -33
- data/src/core/lib/resolver/resolver_registry.cc +149 -0
- data/src/core/lib/resolver/resolver_registry.h +124 -0
- data/src/core/{ext/filters/client_channel → lib/resolver}/server_address.cc +18 -4
- data/src/core/{ext/filters/client_channel → lib/resolver}/server_address.h +17 -10
- data/src/core/lib/resource_quota/api.cc +19 -31
- data/src/core/lib/resource_quota/api.h +5 -3
- data/src/core/lib/{gprpp → resource_quota}/arena.cc +16 -19
- data/src/core/lib/{gprpp → resource_quota}/arena.h +25 -15
- data/src/core/lib/resource_quota/memory_quota.cc +170 -146
- data/src/core/lib/resource_quota/memory_quota.h +131 -90
- data/src/core/lib/resource_quota/resource_quota.h +16 -0
- data/src/core/lib/resource_quota/thread_quota.cc +2 -0
- data/src/core/lib/resource_quota/thread_quota.h +4 -0
- data/src/core/lib/security/authorization/authorization_policy_provider.h +14 -0
- data/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc +4 -0
- data/src/core/lib/security/authorization/evaluate_args.cc +34 -23
- data/src/core/lib/security/authorization/evaluate_args.h +7 -4
- data/src/core/lib/security/authorization/grpc_authorization_engine.cc +66 -0
- data/src/core/lib/security/authorization/grpc_authorization_engine.h +69 -0
- data/src/core/lib/security/authorization/grpc_server_authz_filter.cc +121 -0
- data/src/core/lib/security/authorization/grpc_server_authz_filter.h +61 -0
- data/src/core/lib/security/authorization/matchers.cc +235 -0
- data/src/core/lib/security/authorization/matchers.h +218 -0
- data/src/core/lib/security/authorization/rbac_policy.cc +447 -0
- data/src/core/lib/security/authorization/rbac_policy.h +178 -0
- data/src/core/lib/security/context/security_context.cc +9 -4
- data/src/core/lib/security/context/security_context.h +23 -4
- data/src/core/lib/security/credentials/alts/alts_credentials.cc +16 -7
- data/src/core/lib/security/credentials/alts/alts_credentials.h +16 -1
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc +1 -3
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc +1 -4
- data/src/core/lib/security/credentials/call_creds_util.cc +97 -0
- data/src/core/lib/security/credentials/call_creds_util.h +43 -0
- data/src/core/lib/security/credentials/channel_creds_registry.h +103 -0
- data/src/core/lib/security/credentials/channel_creds_registry_init.cc +80 -0
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +31 -86
- data/src/core/lib/security/credentials/composite/composite_credentials.h +41 -13
- data/src/core/lib/security/credentials/credentials.cc +6 -11
- data/src/core/lib/security/credentials/credentials.h +90 -87
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +154 -39
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +19 -0
- data/src/core/lib/security/credentials/external/aws_request_signer.cc +9 -0
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +78 -42
- data/src/core/lib/security/credentials/external/external_account_credentials.h +16 -9
- data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +12 -5
- data/src/core/lib/security/credentials/external/file_external_account_credentials.h +6 -0
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +55 -17
- data/src/core/lib/security/credentials/external/url_external_account_credentials.h +11 -0
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +40 -32
- data/src/core/lib/security/credentials/fake/fake_credentials.h +35 -22
- data/src/core/lib/security/credentials/google_default/credentials_generic.cc +1 -0
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +69 -35
- data/src/core/lib/security/credentials/google_default/google_default_credentials.h +20 -5
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +32 -30
- data/src/core/lib/security/credentials/iam/iam_credentials.h +25 -9
- data/src/core/lib/security/credentials/insecure/insecure_credentials.cc +35 -26
- data/src/core/lib/security/credentials/insecure/insecure_credentials.h +62 -0
- data/src/core/lib/security/credentials/jwt/json_token.cc +9 -8
- data/src/core/lib/security/credentials/jwt/json_token.h +2 -2
- data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +44 -49
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +30 -12
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +81 -43
- data/src/core/lib/security/credentials/jwt/jwt_verifier.h +5 -3
- data/src/core/lib/security/credentials/local/local_credentials.cc +16 -9
- data/src/core/lib/security/credentials/local/local_credentials.h +17 -0
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +175 -171
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +81 -34
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +104 -156
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +80 -27
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +18 -14
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +27 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc +6 -6
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +9 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +39 -10
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +56 -4
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc +43 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +72 -10
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +29 -5
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +67 -80
- data/src/core/lib/security/credentials/tls/tls_credentials.cc +26 -8
- data/src/core/lib/security/credentials/tls/tls_credentials.h +11 -1
- data/src/core/lib/security/credentials/tls/tls_utils.cc +2 -0
- data/src/core/lib/security/credentials/tls/tls_utils.h +1 -1
- data/src/core/lib/security/credentials/xds/xds_credentials.cc +65 -51
- data/src/core/lib/security/credentials/xds/xds_credentials.h +51 -6
- data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +30 -16
- data/src/core/lib/security/security_connector/alts/alts_security_connector.h +7 -4
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +22 -14
- data/src/core/lib/security/security_connector/fake/fake_security_connector.h +2 -4
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +15 -16
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +21 -11
- data/src/core/lib/security/security_connector/load_system_roots_fallback.cc +5 -3
- data/src/core/lib/security/security_connector/{load_system_roots_linux.cc → load_system_roots_supported.cc} +27 -19
- data/src/core/lib/security/security_connector/{load_system_roots_linux.h → load_system_roots_supported.h} +5 -5
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +32 -21
- data/src/core/lib/security/security_connector/local/local_security_connector.h +6 -2
- data/src/core/lib/security/security_connector/security_connector.cc +22 -32
- data/src/core/lib/security/security_connector/security_connector.h +44 -28
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +29 -20
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +4 -2
- data/src/core/lib/security/security_connector/ssl_utils.cc +41 -33
- data/src/core/lib/security/security_connector/ssl_utils.h +23 -24
- data/src/core/lib/security/security_connector/ssl_utils_config.h +1 -1
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +46 -28
- data/src/core/lib/security/security_connector/tls/tls_security_connector.h +29 -9
- data/src/core/lib/security/transport/auth_filters.h +45 -5
- data/src/core/lib/security/transport/client_auth_filter.cc +112 -368
- data/src/core/lib/security/transport/secure_endpoint.cc +267 -137
- data/src/core/lib/security/transport/secure_endpoint.h +5 -4
- data/src/core/lib/security/transport/security_handshaker.cc +69 -26
- data/src/core/lib/security/transport/security_handshaker.h +5 -1
- data/src/core/lib/security/transport/server_auth_filter.cc +70 -41
- data/src/core/lib/security/util/json_util.cc +3 -2
- data/src/core/lib/security/util/json_util.h +0 -2
- data/src/core/lib/service_config/service_config.h +78 -0
- data/src/core/{ext → lib}/service_config/service_config_call_data.h +11 -7
- data/src/core/{ext/service_config/service_config.cc → lib/service_config/service_config_impl.cc} +33 -23
- data/src/core/{ext/service_config/service_config.h → lib/service_config/service_config_impl.h} +24 -21
- data/src/core/{ext → lib}/service_config/service_config_parser.cc +39 -29
- data/src/core/{ext → lib}/service_config/service_config_parser.h +45 -29
- data/src/core/lib/slice/b64.cc +1 -1
- data/src/core/lib/slice/b64.h +2 -0
- data/src/core/lib/slice/percent_encoding.cc +4 -1
- data/src/core/lib/slice/percent_encoding.h +0 -6
- data/src/core/lib/slice/slice.cc +78 -180
- data/src/core/lib/slice/slice.h +77 -29
- data/src/core/lib/slice/slice_api.cc +1 -1
- data/src/core/lib/slice/slice_buffer.cc +79 -23
- data/src/core/lib/slice/slice_buffer.h +137 -0
- data/src/core/lib/{iomgr/is_epollexclusive_available.h → slice/slice_buffer_api.cc} +11 -12
- data/src/core/lib/slice/slice_internal.h +16 -34
- data/src/core/lib/slice/slice_refcount.cc +18 -0
- data/src/core/lib/slice/slice_refcount.h +6 -86
- data/src/core/lib/slice/slice_refcount_base.h +18 -139
- data/src/core/lib/slice/slice_string_helpers.cc +0 -16
- data/src/core/lib/slice/slice_string_helpers.h +1 -8
- data/src/core/lib/surface/builtins.cc +11 -6
- data/src/core/lib/surface/byte_buffer.cc +7 -1
- data/src/core/lib/surface/byte_buffer_reader.cc +4 -4
- data/src/core/lib/surface/call.cc +1113 -1275
- data/src/core/lib/surface/call.h +26 -22
- data/src/core/lib/surface/call_details.cc +4 -4
- data/src/core/lib/surface/call_log_batch.cc +7 -1
- data/src/core/lib/surface/call_test_only.h +4 -1
- data/src/core/lib/surface/channel.cc +220 -289
- data/src/core/lib/surface/channel.h +100 -62
- data/src/core/lib/surface/channel_init.cc +2 -3
- data/src/core/lib/surface/channel_init.h +4 -6
- data/src/core/lib/surface/channel_ping.cc +8 -2
- data/src/core/lib/surface/channel_stack_type.cc +0 -2
- data/src/core/lib/surface/channel_stack_type.h +0 -2
- data/src/core/lib/surface/completion_queue.cc +39 -29
- data/src/core/lib/surface/completion_queue.h +7 -2
- data/src/core/lib/surface/completion_queue_factory.cc +1 -0
- data/src/core/lib/surface/completion_queue_factory.h +1 -3
- data/src/core/lib/surface/event_string.cc +1 -7
- data/src/core/lib/surface/event_string.h +1 -1
- data/src/core/lib/surface/init.cc +66 -26
- data/src/core/lib/surface/init.h +0 -10
- data/src/core/lib/surface/lame_client.cc +63 -109
- data/src/core/lib/surface/lame_client.h +41 -3
- data/src/core/lib/surface/metadata_array.cc +2 -0
- data/src/core/lib/surface/server.cc +106 -126
- data/src/core/lib/surface/server.h +48 -16
- data/src/core/lib/surface/validate_metadata.cc +3 -6
- data/src/core/lib/surface/validate_metadata.h +3 -0
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/bdp_estimator.cc +12 -11
- data/src/core/lib/transport/bdp_estimator.h +4 -5
- data/src/core/lib/transport/connectivity_state.cc +6 -4
- data/src/core/lib/transport/connectivity_state.h +2 -3
- data/src/core/lib/transport/error_utils.cc +21 -11
- data/src/core/lib/transport/error_utils.h +7 -2
- data/src/core/lib/{channel → transport}/handshaker.cc +13 -8
- data/src/core/lib/{channel → transport}/handshaker.h +14 -7
- data/src/core/lib/{channel → transport}/handshaker_factory.h +9 -10
- data/src/core/lib/{channel → transport}/handshaker_registry.cc +5 -1
- data/src/core/lib/{channel → transport}/handshaker_registry.h +5 -4
- data/src/core/{ext/filters/client_channel → lib/transport}/http_connect_handshaker.cc +37 -26
- data/src/core/{ext/filters/client_channel → lib/transport}/http_connect_handshaker.h +3 -3
- data/src/core/lib/transport/metadata_batch.cc +260 -72
- data/src/core/lib/transport/metadata_batch.h +932 -799
- data/src/core/lib/transport/parsed_metadata.cc +4 -0
- data/src/core/lib/transport/parsed_metadata.h +124 -98
- data/src/core/lib/transport/status_conversion.cc +4 -2
- data/src/core/lib/transport/status_conversion.h +3 -3
- data/src/core/lib/transport/tcp_connect_handshaker.cc +253 -0
- data/src/core/lib/transport/tcp_connect_handshaker.h +39 -0
- data/src/core/lib/transport/timeout_encoding.cc +203 -70
- data/src/core/lib/transport/timeout_encoding.h +44 -10
- data/src/core/lib/transport/transport.cc +21 -21
- data/src/core/lib/transport/transport.h +151 -19
- data/src/core/lib/transport/transport_fwd.h +20 -0
- data/src/core/lib/transport/transport_impl.h +25 -0
- data/src/core/lib/transport/transport_op_string.cc +21 -64
- data/src/core/lib/uri/uri_parser.cc +238 -56
- data/src/core/lib/uri/uri_parser.h +37 -25
- data/src/core/plugin_registry/grpc_plugin_registry.cc +32 -91
- data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +85 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +27 -22
- data/src/core/tsi/alts/handshaker/alts_shared_resource.cc +9 -1
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +22 -14
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.cc +2 -2
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.h +1 -1
- data/src/core/tsi/alts/handshaker/transport_security_common_api.cc +2 -2
- data/src/core/tsi/alts/handshaker/transport_security_common_api.h +2 -2
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +9 -1
- data/src/core/tsi/fake_transport_security.cc +13 -1
- data/src/core/tsi/fake_transport_security.h +6 -0
- data/src/core/tsi/local_transport_security.cc +3 -11
- data/src/core/tsi/local_transport_security.h +1 -4
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.cc +141 -0
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.h +81 -0
- data/src/core/tsi/ssl/session_cache/ssl_session.h +3 -3
- data/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +2 -0
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +3 -5
- data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +2 -0
- data/src/core/tsi/ssl_transport_security.cc +180 -52
- data/src/core/tsi/ssl_transport_security.h +46 -8
- data/src/core/tsi/transport_security_grpc.cc +3 -2
- data/src/core/tsi/transport_security_grpc.h +5 -2
- data/src/core/tsi/transport_security_interface.h +2 -0
- data/src/ruby/ext/grpc/ext-export-truffleruby.clang +2 -0
- data/src/ruby/ext/grpc/ext-export-truffleruby.gcc +7 -0
- data/src/ruby/ext/grpc/ext-export.clang +1 -0
- data/src/ruby/ext/grpc/ext-export.gcc +1 -0
- data/src/ruby/ext/grpc/extconf.rb +59 -21
- data/src/ruby/ext/grpc/rb_channel.c +5 -2
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +20 -24
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +31 -37
- data/src/ruby/ext/grpc/rb_server.c +7 -4
- data/src/ruby/lib/grpc/errors.rb +1 -1
- data/src/ruby/lib/grpc/generic/active_call.rb +7 -1
- data/src/ruby/lib/grpc/grpc.rb +1 -1
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/generate_proto_ruby.sh +1 -0
- data/src/ruby/pb/src/proto/grpc/testing/test_pb.rb +2 -1
- data/src/ruby/pb/test/client.rb +769 -0
- data/src/ruby/pb/test/server.rb +252 -0
- data/src/ruby/pb/test/xds_client.rb +415 -0
- data/src/ruby/spec/generic/client_stub_spec.rb +23 -23
- data/third_party/abseil-cpp/absl/algorithm/container.h +1 -1
- data/third_party/abseil-cpp/absl/base/attributes.h +49 -22
- data/third_party/abseil-cpp/absl/base/casts.h +61 -68
- data/third_party/abseil-cpp/absl/base/config.h +182 -41
- data/third_party/abseil-cpp/absl/base/internal/cycleclock.cc +12 -42
- data/third_party/abseil-cpp/absl/base/internal/cycleclock.h +67 -2
- data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +3 -3
- data/third_party/abseil-cpp/absl/base/internal/endian.h +17 -62
- data/third_party/abseil-cpp/absl/base/internal/fast_type_id.h +50 -0
- data/third_party/abseil-cpp/absl/base/internal/invoke.h +54 -0
- data/third_party/abseil-cpp/absl/base/internal/prefetch.h +138 -0
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +29 -22
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +13 -12
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +3 -0
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +8 -0
- data/third_party/abseil-cpp/absl/base/internal/spinlock_linux.inc +2 -5
- data/third_party/abseil-cpp/absl/base/internal/strerror.cc +88 -0
- data/third_party/abseil-cpp/absl/base/internal/strerror.h +39 -0
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +0 -1
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.cc +2 -1
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +6 -7
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +12 -3
- data/third_party/abseil-cpp/absl/base/log_severity.cc +28 -0
- data/third_party/abseil-cpp/absl/base/log_severity.h +51 -0
- data/third_party/abseil-cpp/absl/base/optimization.h +19 -11
- data/third_party/abseil-cpp/absl/base/options.h +1 -1
- data/third_party/abseil-cpp/absl/base/thread_annotations.h +2 -2
- data/third_party/abseil-cpp/absl/container/fixed_array.h +2 -0
- data/third_party/abseil-cpp/absl/container/flat_hash_map.h +11 -4
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +510 -0
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +20 -9
- data/third_party/abseil-cpp/absl/container/internal/common.h +6 -5
- data/third_party/abseil-cpp/absl/container/internal/container_memory.h +10 -28
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +68 -20
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +29 -11
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +59 -38
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +4 -0
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +515 -184
- data/third_party/abseil-cpp/absl/debugging/internal/address_is_readable.cc +45 -88
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc +4 -0
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h +3 -2
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +8 -3
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc +8 -3
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h +2 -1
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +8 -3
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +20 -18
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +8 -3
- data/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc +15 -2
- data/third_party/abseil-cpp/absl/debugging/symbolize.cc +6 -1
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +46 -7
- data/third_party/abseil-cpp/absl/functional/bind_front.h +10 -1
- data/third_party/abseil-cpp/absl/functional/function_ref.h +2 -1
- data/third_party/abseil-cpp/absl/hash/hash.h +82 -8
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +218 -23
- data/third_party/abseil-cpp/absl/numeric/bits.h +2 -1
- data/third_party/abseil-cpp/absl/numeric/int128.cc +4 -2
- data/third_party/abseil-cpp/absl/numeric/int128.h +2 -2
- data/third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h +21 -6
- data/third_party/abseil-cpp/absl/random/bernoulli_distribution.h +200 -0
- data/third_party/abseil-cpp/absl/random/beta_distribution.h +427 -0
- data/third_party/abseil-cpp/absl/random/discrete_distribution.cc +98 -0
- data/third_party/abseil-cpp/absl/random/discrete_distribution.h +247 -0
- data/third_party/abseil-cpp/absl/random/distributions.h +452 -0
- data/third_party/abseil-cpp/absl/random/exponential_distribution.h +165 -0
- data/third_party/abseil-cpp/absl/random/gaussian_distribution.cc +104 -0
- data/third_party/abseil-cpp/absl/random/gaussian_distribution.h +275 -0
- data/third_party/abseil-cpp/absl/random/internal/distribution_caller.h +95 -0
- data/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h +269 -0
- data/third_party/abseil-cpp/absl/random/internal/fastmath.h +57 -0
- data/third_party/abseil-cpp/absl/random/internal/generate_real.h +144 -0
- data/third_party/abseil-cpp/absl/random/internal/iostream_state_saver.h +245 -0
- data/third_party/abseil-cpp/absl/random/internal/nonsecure_base.h +161 -0
- data/third_party/abseil-cpp/absl/random/internal/pcg_engine.h +308 -0
- data/third_party/abseil-cpp/absl/random/internal/platform.h +171 -0
- data/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc +253 -0
- data/third_party/abseil-cpp/absl/random/internal/pool_urbg.h +131 -0
- data/third_party/abseil-cpp/absl/random/internal/randen.cc +91 -0
- data/third_party/abseil-cpp/absl/random/internal/randen.h +96 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_detect.cc +225 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_detect.h +33 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_engine.h +264 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_hwaes.cc +526 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_hwaes.h +50 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_round_keys.cc +462 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_slow.cc +471 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_slow.h +40 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_traits.h +88 -0
- data/third_party/abseil-cpp/absl/random/internal/salted_seed_seq.h +165 -0
- data/third_party/abseil-cpp/absl/random/internal/seed_material.cc +267 -0
- data/third_party/abseil-cpp/absl/random/internal/seed_material.h +104 -0
- data/third_party/abseil-cpp/absl/random/internal/traits.h +149 -0
- data/third_party/abseil-cpp/absl/random/internal/uniform_helper.h +244 -0
- data/third_party/abseil-cpp/absl/random/internal/wide_multiply.h +96 -0
- data/third_party/abseil-cpp/absl/random/log_uniform_int_distribution.h +256 -0
- data/third_party/abseil-cpp/absl/random/poisson_distribution.h +261 -0
- data/third_party/abseil-cpp/absl/random/random.h +189 -0
- data/third_party/abseil-cpp/absl/random/seed_gen_exception.cc +46 -0
- data/third_party/abseil-cpp/absl/random/seed_gen_exception.h +55 -0
- data/third_party/abseil-cpp/absl/random/seed_sequences.cc +29 -0
- data/third_party/abseil-cpp/absl/random/seed_sequences.h +111 -0
- data/third_party/abseil-cpp/absl/random/uniform_int_distribution.h +275 -0
- data/third_party/abseil-cpp/absl/random/uniform_real_distribution.h +202 -0
- data/third_party/abseil-cpp/absl/random/zipf_distribution.h +272 -0
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +17 -0
- data/third_party/abseil-cpp/absl/status/status.cc +174 -2
- data/third_party/abseil-cpp/absl/status/status.h +22 -12
- data/third_party/abseil-cpp/absl/status/statusor.h +9 -3
- data/third_party/abseil-cpp/absl/strings/ascii.h +4 -4
- data/third_party/abseil-cpp/absl/strings/cord.cc +194 -913
- data/third_party/abseil-cpp/absl/strings/cord.h +202 -81
- data/third_party/abseil-cpp/absl/strings/cord_analysis.cc +188 -0
- data/third_party/abseil-cpp/absl/strings/cord_analysis.h +44 -0
- data/third_party/abseil-cpp/absl/strings/cord_buffer.cc +30 -0
- data/third_party/abseil-cpp/absl/strings/cord_buffer.h +572 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_data_edge.h +63 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc +20 -32
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +123 -88
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +149 -49
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h +44 -59
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc +3 -1
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.h +4 -2
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.cc +3 -2
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.h +5 -4
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc +7 -74
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.cc +54 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.h +102 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h +58 -17
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc +13 -11
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +11 -38
- data/third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h +1 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker.h +4 -2
- data/third_party/abseil-cpp/absl/strings/internal/escaping.cc +6 -5
- data/third_party/abseil-cpp/absl/strings/internal/ostringstream.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +38 -7
- data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +7 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +4 -5
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +5 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_format/output.h +2 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +4 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_join_internal.h +9 -6
- data/third_party/abseil-cpp/absl/strings/internal/string_constant.h +10 -2
- data/third_party/abseil-cpp/absl/strings/internal/utf8.cc +9 -9
- data/third_party/abseil-cpp/absl/strings/numbers.cc +8 -8
- data/third_party/abseil-cpp/absl/strings/numbers.h +26 -23
- data/third_party/abseil-cpp/absl/strings/str_cat.h +20 -13
- data/third_party/abseil-cpp/absl/strings/str_join.h +9 -15
- data/third_party/abseil-cpp/absl/strings/str_split.h +1 -2
- data/third_party/abseil-cpp/absl/strings/string_view.cc +2 -13
- data/third_party/abseil-cpp/absl/strings/string_view.h +3 -2
- data/third_party/abseil-cpp/absl/strings/strip.h +8 -6
- data/third_party/abseil-cpp/absl/strings/substitute.h +10 -2
- data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc +9 -6
- data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.h +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +1 -6
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc +0 -25
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.h +10 -4
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +75 -40
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +17 -9
- data/third_party/abseil-cpp/absl/synchronization/notification.h +3 -2
- data/third_party/abseil-cpp/absl/time/duration.cc +5 -4
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h +11 -7
- data/third_party/abseil-cpp/absl/time/time.h +16 -12
- data/third_party/abseil-cpp/absl/types/internal/optional.h +8 -0
- data/third_party/abseil-cpp/absl/types/internal/variant.h +3 -3
- data/third_party/abseil-cpp/absl/types/optional.h +17 -14
- data/third_party/abseil-cpp/absl/types/span.h +2 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/base64/base64.c +13 -0
- data/third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c +21 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/cipher.c +12 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/ecdsa.c +1 -2
- data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/mem.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7.c +29 -0
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/internal.h +0 -1
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/base64.h +8 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/cipher.h +13 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/dsa.h +10 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/pkcs7.h +9 -4
- data/third_party/boringssl-with-bazel/src/include/openssl/pkcs8.h +6 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +23 -2
- data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +4 -0
- data/third_party/cares/cares/{ares.h → include/ares.h} +73 -1
- data/third_party/cares/cares/{ares_dns.h → include/ares_dns.h} +9 -0
- data/third_party/cares/cares/{ares_version.h → include/ares_version.h} +3 -3
- data/third_party/cares/cares/{ares__close_sockets.c → src/lib/ares__close_sockets.c} +2 -2
- data/third_party/cares/cares/{ares__get_hostent.c → src/lib/ares__get_hostent.c} +1 -2
- data/third_party/cares/cares/src/lib/ares__parse_into_addrinfo.c +260 -0
- data/third_party/cares/cares/src/lib/ares__readaddrinfo.c +264 -0
- data/third_party/cares/cares/src/lib/ares__sortaddrinfo.c +499 -0
- data/third_party/cares/cares/src/lib/ares_android.c +444 -0
- data/third_party/cares/cares/src/lib/ares_android.h +27 -0
- data/third_party/cares/cares/{ares_create_query.c → src/lib/ares_create_query.c} +8 -17
- data/third_party/cares/cares/{ares_data.c → src/lib/ares_data.c} +18 -0
- data/third_party/cares/cares/{ares_data.h → src/lib/ares_data.h} +2 -0
- data/third_party/cares/cares/{ares_expand_name.c → src/lib/ares_expand_name.c} +114 -23
- data/third_party/cares/cares/{ares_expand_string.c → src/lib/ares_expand_string.c} +2 -5
- data/third_party/cares/cares/{ares_free_hostent.c → src/lib/ares_free_hostent.c} +6 -4
- data/third_party/cares/cares/src/lib/ares_freeaddrinfo.c +59 -0
- data/third_party/cares/cares/src/lib/ares_getaddrinfo.c +772 -0
- data/third_party/cares/cares/{ares_getenv.c → src/lib/ares_getenv.c} +0 -2
- data/third_party/cares/cares/{ares_gethostbyaddr.c → src/lib/ares_gethostbyaddr.c} +2 -9
- data/third_party/cares/cares/{ares_gethostbyname.c → src/lib/ares_gethostbyname.c} +25 -20
- data/third_party/cares/cares/{ares_getnameinfo.c → src/lib/ares_getnameinfo.c} +4 -10
- data/third_party/cares/cares/{ares_init.c → src/lib/ares_init.c} +79 -40
- data/third_party/cares/cares/{ares_ipv6.h → src/lib/ares_ipv6.h} +7 -0
- data/third_party/cares/cares/{ares_library_init.c → src/lib/ares_library_init.c} +7 -2
- data/third_party/cares/cares/{ares_library_init.h → src/lib/ares_library_init.h} +1 -1
- data/third_party/cares/cares/src/lib/ares_nameser.h +482 -0
- data/third_party/cares/cares/src/lib/ares_parse_a_reply.c +209 -0
- data/third_party/cares/cares/src/lib/ares_parse_aaaa_reply.c +212 -0
- data/third_party/cares/cares/src/lib/ares_parse_caa_reply.c +199 -0
- data/third_party/cares/cares/{ares_parse_mx_reply.c → src/lib/ares_parse_mx_reply.c} +2 -8
- data/third_party/cares/cares/{ares_parse_naptr_reply.c → src/lib/ares_parse_naptr_reply.c} +2 -13
- data/third_party/cares/cares/{ares_parse_ns_reply.c → src/lib/ares_parse_ns_reply.c} +5 -11
- data/third_party/cares/cares/{ares_parse_ptr_reply.c → src/lib/ares_parse_ptr_reply.c} +53 -46
- data/third_party/cares/cares/src/lib/ares_parse_soa_reply.c +179 -0
- data/third_party/cares/cares/{ares_parse_srv_reply.c → src/lib/ares_parse_srv_reply.c} +2 -13
- data/third_party/cares/cares/{ares_parse_txt_reply.c → src/lib/ares_parse_txt_reply.c} +3 -9
- data/third_party/cares/cares/{ares_private.h → src/lib/ares_private.h} +52 -11
- data/third_party/cares/cares/{ares_process.c → src/lib/ares_process.c} +127 -52
- data/third_party/cares/cares/{ares_query.c → src/lib/ares_query.c} +3 -9
- data/third_party/cares/cares/{ares_search.c → src/lib/ares_search.c} +5 -7
- data/third_party/cares/cares/{ares_send.c → src/lib/ares_send.c} +2 -8
- data/third_party/cares/cares/{ares_setup.h → src/lib/ares_setup.h} +4 -1
- data/third_party/cares/cares/{ares_strsplit.c → src/lib/ares_strsplit.c} +4 -0
- data/third_party/cares/cares/src/lib/ares_writev.h +36 -0
- data/third_party/cares/cares/src/lib/config-dos.h +115 -0
- data/third_party/cares/cares/{inet_net_pton.c → src/lib/inet_net_pton.c} +2 -8
- data/third_party/cares/cares/{inet_ntop.c → src/lib/inet_ntop.c} +2 -8
- data/third_party/upb/third_party/utf8_range/naive.c +92 -0
- data/third_party/upb/third_party/utf8_range/range2-neon.c +157 -0
- data/third_party/upb/third_party/utf8_range/range2-sse.c +170 -0
- data/third_party/upb/third_party/utf8_range/utf8_range.h +9 -0
- data/third_party/upb/upb/decode.c +542 -319
- data/third_party/upb/upb/decode.h +43 -17
- data/third_party/upb/upb/decode_fast.c +303 -301
- data/third_party/upb/upb/decode_fast.h +18 -18
- data/third_party/upb/upb/decode_internal.h +73 -56
- data/third_party/upb/upb/def.c +1926 -1078
- data/third_party/upb/upb/def.h +329 -288
- data/third_party/upb/upb/def.hpp +129 -172
- data/third_party/upb/upb/encode.c +208 -175
- data/third_party/upb/upb/encode.h +15 -17
- data/third_party/upb/upb/json_encode.c +776 -0
- data/third_party/upb/upb/json_encode.h +62 -0
- data/third_party/upb/upb/msg.c +142 -124
- data/third_party/upb/upb/msg.h +39 -33
- data/third_party/upb/upb/msg_internal.h +342 -280
- data/third_party/upb/upb/port_def.inc +8 -0
- data/third_party/upb/upb/port_undef.inc +1 -0
- data/third_party/upb/upb/reflection.c +239 -199
- data/third_party/upb/upb/reflection.h +87 -67
- data/third_party/upb/upb/reflection.hpp +6 -6
- data/third_party/upb/upb/table.c +231 -147
- data/third_party/upb/upb/table_internal.h +129 -95
- data/third_party/upb/upb/text_encode.c +113 -90
- data/third_party/upb/upb/text_encode.h +10 -10
- data/third_party/upb/upb/upb.c +111 -72
- data/third_party/upb/upb/upb.h +157 -151
- data/third_party/upb/upb/upb.hpp +31 -28
- data/third_party/upb/upb/upb_internal.h +21 -11
- data/third_party/xxhash/xxhash.h +607 -352
- data/third_party/zlib/crc32.c +966 -292
- data/third_party/zlib/crc32.h +9441 -436
- data/third_party/zlib/deflate.c +78 -30
- data/third_party/zlib/deflate.h +12 -15
- data/third_party/zlib/gzguts.h +3 -2
- data/third_party/zlib/gzlib.c +5 -3
- data/third_party/zlib/gzread.c +5 -7
- data/third_party/zlib/gzwrite.c +25 -13
- data/third_party/zlib/infback.c +2 -1
- data/third_party/zlib/inffast.c +14 -14
- data/third_party/zlib/inflate.c +39 -8
- data/third_party/zlib/inflate.h +3 -2
- data/third_party/zlib/inftrees.c +3 -3
- data/third_party/zlib/trees.c +27 -48
- data/third_party/zlib/zlib.h +123 -100
- data/third_party/zlib/zutil.c +2 -2
- data/third_party/zlib/zutil.h +12 -9
- metadata +502 -247
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +0 -44
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +0 -83
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc +0 -31
- data/src/core/ext/filters/client_channel/resolver_registry.cc +0 -194
- data/src/core/ext/filters/client_channel/resolver_registry.h +0 -88
- data/src/core/ext/filters/client_idle/client_idle_filter.cc +0 -264
- data/src/core/ext/filters/max_age/max_age_filter.cc +0 -560
- data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +0 -122
- data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +0 -92
- data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +0 -192
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +0 -52
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +0 -79
- data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +0 -125
- data/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc +0 -37
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_index.h +0 -107
- data/src/core/ext/transport/chttp2/transport/hpack_utils.cc +0 -46
- data/src/core/ext/transport/chttp2/transport/popularity_count.h +0 -60
- data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c +0 -38
- data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h +0 -64
- data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c +0 -38
- data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h +0 -64
- data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c +0 -38
- data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h +0 -64
- data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c +0 -38
- data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h +0 -64
- data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c +0 -38
- data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h +0 -64
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.c +0 -102
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.h +0 -306
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.c +0 -56
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.h +0 -135
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.c +0 -115
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.h +0 -371
- data/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c +0 -67
- data/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h +0 -35
- data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c +0 -68
- data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h +0 -35
- data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c +0 -67
- data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h +0 -35
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c +0 -75
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h +0 -35
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c +0 -69
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h +0 -35
- data/src/core/lib/compression/algorithm_metadata.h +0 -62
- data/src/core/lib/compression/compression_args.cc +0 -140
- data/src/core/lib/compression/compression_args.h +0 -58
- data/src/core/lib/compression/stream_compression.cc +0 -81
- data/src/core/lib/compression/stream_compression.h +0 -117
- data/src/core/lib/compression/stream_compression_gzip.cc +0 -231
- data/src/core/lib/compression/stream_compression_gzip.h +0 -28
- data/src/core/lib/compression/stream_compression_identity.cc +0 -91
- data/src/core/lib/compression/stream_compression_identity.h +0 -29
- data/src/core/lib/event_engine/event_engine_factory.cc +0 -49
- data/src/core/lib/event_engine/sockaddr.cc +0 -40
- data/src/core/lib/event_engine/sockaddr.h +0 -44
- data/src/core/lib/iomgr/ev_epollex_linux.cc +0 -1654
- data/src/core/lib/iomgr/ev_epollex_linux.h +0 -30
- data/src/core/lib/iomgr/event_engine/closure.cc +0 -77
- data/src/core/lib/iomgr/event_engine/closure.h +0 -42
- data/src/core/lib/iomgr/event_engine/endpoint.cc +0 -172
- data/src/core/lib/iomgr/event_engine/endpoint.h +0 -52
- data/src/core/lib/iomgr/event_engine/iomgr.cc +0 -84
- data/src/core/lib/iomgr/event_engine/pollset.cc +0 -88
- data/src/core/lib/iomgr/event_engine/resolver.cc +0 -115
- data/src/core/lib/iomgr/event_engine/tcp.cc +0 -295
- data/src/core/lib/iomgr/event_engine/timer.cc +0 -63
- data/src/core/lib/iomgr/iomgr_custom.cc +0 -79
- data/src/core/lib/iomgr/iomgr_custom.h +0 -49
- data/src/core/lib/iomgr/is_epollexclusive_available.cc +0 -119
- data/src/core/lib/iomgr/pollset_custom.cc +0 -105
- data/src/core/lib/iomgr/pollset_custom.h +0 -37
- data/src/core/lib/iomgr/pollset_set_custom.cc +0 -47
- data/src/core/lib/iomgr/pollset_set_custom.h +0 -26
- data/src/core/lib/iomgr/resolve_address_custom.cc +0 -169
- data/src/core/lib/iomgr/resolve_address_custom.h +0 -44
- data/src/core/lib/iomgr/sys_epoll_wrapper.h +0 -30
- data/src/core/lib/iomgr/tcp_client_custom.cc +0 -146
- data/src/core/lib/iomgr/tcp_custom.cc +0 -350
- data/src/core/lib/iomgr/tcp_custom.h +0 -85
- data/src/core/lib/iomgr/tcp_server_custom.cc +0 -457
- data/src/core/lib/iomgr/timer_custom.cc +0 -96
- data/src/core/lib/iomgr/timer_custom.h +0 -43
- data/src/core/lib/security/authorization/sdk_server_authz_filter.cc +0 -173
- data/src/core/lib/security/authorization/sdk_server_authz_filter.h +0 -67
- data/src/core/lib/security/credentials/credentials_metadata.cc +0 -61
- data/src/core/lib/slice/slice_intern.cc +0 -367
- data/src/core/lib/slice/slice_split.cc +0 -100
- data/src/core/lib/slice/slice_split.h +0 -40
- data/src/core/lib/slice/slice_utils.h +0 -200
- data/src/core/lib/slice/static_slice.cc +0 -377
- data/src/core/lib/slice/static_slice.h +0 -300
- data/src/core/lib/surface/init_secure.cc +0 -103
- data/src/core/lib/transport/byte_stream.cc +0 -162
- data/src/core/lib/transport/byte_stream.h +0 -166
- data/src/core/lib/transport/metadata.cc +0 -714
- data/src/core/lib/transport/metadata.h +0 -449
- data/src/core/lib/transport/static_metadata.cc +0 -1032
- data/src/core/lib/transport/static_metadata.h +0 -322
- data/src/core/lib/transport/status_metadata.cc +0 -63
- data/src/core/lib/transport/status_metadata.h +0 -48
- data/third_party/abseil-cpp/absl/container/internal/have_sse.h +0 -50
- data/third_party/cares/cares/ares_getopt.c +0 -122
- data/third_party/cares/cares/ares_getopt.h +0 -53
- data/third_party/cares/cares/ares_parse_a_reply.c +0 -264
- data/third_party/cares/cares/ares_parse_aaaa_reply.c +0 -264
- data/third_party/cares/cares/ares_parse_soa_reply.c +0 -133
- /data/third_party/cares/cares/{ares_rules.h → include/ares_rules.h} +0 -0
- /data/third_party/cares/cares/{ares__read_line.c → src/lib/ares__read_line.c} +0 -0
- /data/third_party/cares/cares/{ares__timeval.c → src/lib/ares__timeval.c} +0 -0
- /data/third_party/cares/cares/{ares_cancel.c → src/lib/ares_cancel.c} +0 -0
- /data/third_party/cares/cares/{ares_destroy.c → src/lib/ares_destroy.c} +0 -0
- /data/third_party/cares/cares/{ares_fds.c → src/lib/ares_fds.c} +0 -0
- /data/third_party/cares/cares/{ares_free_string.c → src/lib/ares_free_string.c} +0 -0
- /data/third_party/cares/cares/{ares_getenv.h → src/lib/ares_getenv.h} +0 -0
- /data/third_party/cares/cares/{ares_getsock.c → src/lib/ares_getsock.c} +0 -0
- /data/third_party/cares/cares/{ares_inet_net_pton.h → src/lib/ares_inet_net_pton.h} +0 -0
- /data/third_party/cares/cares/{ares_iphlpapi.h → src/lib/ares_iphlpapi.h} +0 -0
- /data/third_party/cares/cares/{ares_llist.c → src/lib/ares_llist.c} +0 -0
- /data/third_party/cares/cares/{ares_llist.h → src/lib/ares_llist.h} +0 -0
- /data/third_party/cares/cares/{ares_mkquery.c → src/lib/ares_mkquery.c} +0 -0
- /data/third_party/cares/cares/{ares_nowarn.c → src/lib/ares_nowarn.c} +0 -0
- /data/third_party/cares/cares/{ares_nowarn.h → src/lib/ares_nowarn.h} +0 -0
- /data/third_party/cares/cares/{ares_options.c → src/lib/ares_options.c} +0 -0
- /data/third_party/cares/cares/{ares_platform.c → src/lib/ares_platform.c} +0 -0
- /data/third_party/cares/cares/{ares_platform.h → src/lib/ares_platform.h} +0 -0
- /data/third_party/cares/cares/{ares_strcasecmp.c → src/lib/ares_strcasecmp.c} +0 -0
- /data/third_party/cares/cares/{ares_strcasecmp.h → src/lib/ares_strcasecmp.h} +0 -0
- /data/third_party/cares/cares/{ares_strdup.c → src/lib/ares_strdup.c} +0 -0
- /data/third_party/cares/cares/{ares_strdup.h → src/lib/ares_strdup.h} +0 -0
- /data/third_party/cares/cares/{ares_strerror.c → src/lib/ares_strerror.c} +0 -0
- /data/third_party/cares/cares/{ares_strsplit.h → src/lib/ares_strsplit.h} +0 -0
- /data/third_party/cares/cares/{ares_timeout.c → src/lib/ares_timeout.c} +0 -0
- /data/third_party/cares/cares/{ares_version.c → src/lib/ares_version.c} +0 -0
- /data/third_party/cares/cares/{ares_writev.c → src/lib/ares_writev.c} +0 -0
- /data/third_party/cares/cares/{bitncmp.c → src/lib/bitncmp.c} +0 -0
- /data/third_party/cares/cares/{bitncmp.h → src/lib/bitncmp.h} +0 -0
- /data/third_party/cares/cares/{config-win32.h → src/lib/config-win32.h} +0 -0
- /data/third_party/cares/cares/{setup_once.h → src/lib/setup_once.h} +0 -0
- /data/third_party/cares/cares/{windows_port.c → src/lib/windows_port.c} +0 -0
@@ -22,39 +22,62 @@
|
|
22
22
|
#include <limits.h>
|
23
23
|
#include <string.h>
|
24
24
|
|
25
|
+
#include <algorithm>
|
26
|
+
|
25
27
|
#include "absl/container/inlined_vector.h"
|
28
|
+
#include "absl/strings/match.h"
|
29
|
+
#include "absl/strings/str_cat.h"
|
26
30
|
#include "absl/strings/str_format.h"
|
27
31
|
#include "absl/strings/str_join.h"
|
32
|
+
#include "absl/strings/str_split.h"
|
28
33
|
#include "absl/strings/string_view.h"
|
34
|
+
#include "absl/strings/strip.h"
|
29
35
|
|
36
|
+
#include <grpc/byte_buffer.h>
|
30
37
|
#include <grpc/byte_buffer_reader.h>
|
31
38
|
#include <grpc/grpc.h>
|
39
|
+
#include <grpc/impl/codegen/connectivity_state.h>
|
40
|
+
#include <grpc/impl/codegen/propagation_bits.h>
|
41
|
+
#include <grpc/slice.h>
|
42
|
+
#include <grpc/status.h>
|
32
43
|
#include <grpc/support/alloc.h>
|
44
|
+
#include <grpc/support/log.h>
|
45
|
+
#include <grpc/support/string_util.h>
|
33
46
|
#include <grpc/support/time.h>
|
34
47
|
|
35
48
|
#include "src/core/ext/filters/client_channel/client_channel.h"
|
49
|
+
#include "src/core/ext/xds/upb_utils.h"
|
36
50
|
#include "src/core/ext/xds/xds_api.h"
|
37
51
|
#include "src/core/ext/xds/xds_bootstrap.h"
|
38
52
|
#include "src/core/ext/xds/xds_channel_args.h"
|
39
53
|
#include "src/core/ext/xds/xds_client_stats.h"
|
54
|
+
#include "src/core/ext/xds/xds_cluster_specifier_plugin.h"
|
40
55
|
#include "src/core/ext/xds/xds_http_filters.h"
|
41
|
-
#include "src/core/lib/address_utils/sockaddr_utils.h"
|
42
56
|
#include "src/core/lib/backoff/backoff.h"
|
43
57
|
#include "src/core/lib/channel/channel_args.h"
|
58
|
+
#include "src/core/lib/channel/channel_fwd.h"
|
44
59
|
#include "src/core/lib/channel/channel_stack.h"
|
60
|
+
#include "src/core/lib/config/core_configuration.h"
|
45
61
|
#include "src/core/lib/gpr/env.h"
|
46
|
-
#include "src/core/lib/gpr/
|
62
|
+
#include "src/core/lib/gpr/useful.h"
|
63
|
+
#include "src/core/lib/gprpp/debug_location.h"
|
47
64
|
#include "src/core/lib/gprpp/memory.h"
|
48
65
|
#include "src/core/lib/gprpp/orphanable.h"
|
49
66
|
#include "src/core/lib/gprpp/ref_counted_ptr.h"
|
50
67
|
#include "src/core/lib/gprpp/sync.h"
|
51
|
-
#include "src/core/lib/iomgr/
|
68
|
+
#include "src/core/lib/iomgr/closure.h"
|
69
|
+
#include "src/core/lib/iomgr/load_file.h"
|
70
|
+
#include "src/core/lib/iomgr/pollset_set.h"
|
52
71
|
#include "src/core/lib/iomgr/timer.h"
|
72
|
+
#include "src/core/lib/security/credentials/channel_creds_registry.h"
|
73
|
+
#include "src/core/lib/security/credentials/credentials.h"
|
74
|
+
#include "src/core/lib/slice/slice.h"
|
53
75
|
#include "src/core/lib/slice/slice_internal.h"
|
54
|
-
#include "src/core/lib/slice/
|
76
|
+
#include "src/core/lib/slice/slice_refcount.h"
|
55
77
|
#include "src/core/lib/surface/call.h"
|
56
78
|
#include "src/core/lib/surface/channel.h"
|
57
|
-
#include "src/core/lib/
|
79
|
+
#include "src/core/lib/surface/lame_client.h"
|
80
|
+
#include "src/core/lib/transport/connectivity_state.h"
|
58
81
|
#include "src/core/lib/uri/uri_parser.h"
|
59
82
|
|
60
83
|
#define GRPC_XDS_INITIAL_CONNECT_BACKOFF_SECONDS 1
|
@@ -78,43 +101,6 @@ char* g_fallback_bootstrap_config ABSL_GUARDED_BY(*g_mu) = nullptr;
|
|
78
101
|
|
79
102
|
} // namespace
|
80
103
|
|
81
|
-
class XdsClient::Notifier {
|
82
|
-
public:
|
83
|
-
// Helper template function to invoke `OnError()` on a list of watchers \a
|
84
|
-
// watchers_list within \a work_serializer. Works with all 4 resource types.
|
85
|
-
template <class T>
|
86
|
-
static void ScheduleNotifyWatchersOnErrorInWorkSerializer(
|
87
|
-
XdsClient* xds_client, const T& watchers_list, grpc_error_handle error,
|
88
|
-
const DebugLocation& location) {
|
89
|
-
xds_client->work_serializer_.Schedule(
|
90
|
-
[watchers_list, error]()
|
91
|
-
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client->work_serializer_) {
|
92
|
-
for (const auto& p : watchers_list) {
|
93
|
-
p.first->OnError(GRPC_ERROR_REF(error));
|
94
|
-
}
|
95
|
-
GRPC_ERROR_UNREF(error);
|
96
|
-
},
|
97
|
-
location);
|
98
|
-
}
|
99
|
-
|
100
|
-
// Helper template function to invoke `OnResourceDoesNotExist()` on a list of
|
101
|
-
// watchers \a watchers_list within \a work_serializer. Works with all 4
|
102
|
-
// resource types.
|
103
|
-
template <class T>
|
104
|
-
static void ScheduleNotifyWatchersOnResourceDoesNotExistInWorkSerializer(
|
105
|
-
XdsClient* xds_client, const T& watchers_list,
|
106
|
-
const DebugLocation& location) {
|
107
|
-
xds_client->work_serializer_.Schedule(
|
108
|
-
[watchers_list]()
|
109
|
-
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client->work_serializer_) {
|
110
|
-
for (const auto& p : watchers_list) {
|
111
|
-
p.first->OnResourceDoesNotExist();
|
112
|
-
}
|
113
|
-
},
|
114
|
-
location);
|
115
|
-
}
|
116
|
-
};
|
117
|
-
|
118
104
|
//
|
119
105
|
// Internal class declarations
|
120
106
|
//
|
@@ -172,21 +158,54 @@ class XdsClient::ChannelState::AdsCallState
|
|
172
158
|
XdsClient* xds_client() const { return chand()->xds_client(); }
|
173
159
|
bool seen_response() const { return seen_response_; }
|
174
160
|
|
175
|
-
void SubscribeLocked(const
|
176
|
-
|
161
|
+
void SubscribeLocked(const XdsResourceType* type, const XdsResourceName& name,
|
162
|
+
bool delay_send)
|
177
163
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
178
|
-
void UnsubscribeLocked(const
|
179
|
-
const
|
180
|
-
bool delay_unsubscription)
|
164
|
+
void UnsubscribeLocked(const XdsResourceType* type,
|
165
|
+
const XdsResourceName& name, bool delay_unsubscription)
|
181
166
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
182
167
|
|
183
168
|
bool HasSubscribedResources() const;
|
184
169
|
|
185
170
|
private:
|
186
|
-
class
|
171
|
+
class AdsResponseParser : public XdsApi::AdsResponseParserInterface {
|
172
|
+
public:
|
173
|
+
struct Result {
|
174
|
+
const XdsResourceType* type;
|
175
|
+
std::string type_url;
|
176
|
+
std::string version;
|
177
|
+
std::string nonce;
|
178
|
+
std::vector<std::string> errors;
|
179
|
+
std::map<std::string /*authority*/, std::set<XdsResourceKey>>
|
180
|
+
resources_seen;
|
181
|
+
bool have_valid_resources = false;
|
182
|
+
};
|
183
|
+
|
184
|
+
explicit AdsResponseParser(AdsCallState* ads_call_state)
|
185
|
+
: ads_call_state_(ads_call_state) {}
|
186
|
+
|
187
|
+
absl::Status ProcessAdsResponseFields(AdsResponseFields fields) override
|
188
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
189
|
+
|
190
|
+
void ParseResource(const XdsEncodingContext& context, size_t idx,
|
191
|
+
absl::string_view type_url,
|
192
|
+
absl::string_view serialized_resource) override
|
193
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
194
|
+
|
195
|
+
Result TakeResult() { return std::move(result_); }
|
196
|
+
|
197
|
+
private:
|
198
|
+
XdsClient* xds_client() const { return ads_call_state_->xds_client(); }
|
199
|
+
|
200
|
+
AdsCallState* ads_call_state_;
|
201
|
+
const Timestamp update_time_ = ExecCtx::Get()->Now();
|
202
|
+
Result result_;
|
203
|
+
};
|
204
|
+
|
205
|
+
class ResourceTimer : public InternallyRefCounted<ResourceTimer> {
|
187
206
|
public:
|
188
|
-
|
189
|
-
:
|
207
|
+
ResourceTimer(const XdsResourceType* type, const XdsResourceName& name)
|
208
|
+
: type_(type), name_(name) {
|
190
209
|
GRPC_CLOSURE_INIT(&timer_callback_, OnTimer, this,
|
191
210
|
grpc_schedule_on_exec_ctx);
|
192
211
|
}
|
@@ -196,9 +215,20 @@ class XdsClient::ChannelState::AdsCallState
|
|
196
215
|
Unref(DEBUG_LOCATION, "Orphan");
|
197
216
|
}
|
198
217
|
|
199
|
-
void MaybeStartTimer(RefCountedPtr<AdsCallState> ads_calld)
|
200
|
-
|
201
|
-
|
218
|
+
void MaybeStartTimer(RefCountedPtr<AdsCallState> ads_calld)
|
219
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_) {
|
220
|
+
if (!timer_start_needed_) return;
|
221
|
+
timer_start_needed_ = false;
|
222
|
+
// Check if we already have a cached version of this resource
|
223
|
+
// (i.e., if this is the initial request for the resource after an
|
224
|
+
// ADS stream restart). If so, we don't start the timer, because
|
225
|
+
// (a) we already have the resource and (b) the server may
|
226
|
+
// optimize by not resending the resource that we already have.
|
227
|
+
auto& authority_state =
|
228
|
+
ads_calld->xds_client()->authority_state_map_[name_.authority];
|
229
|
+
ResourceState& state = authority_state.resource_map[type_][name_.key];
|
230
|
+
if (state.resource != nullptr) return;
|
231
|
+
// Start timer.
|
202
232
|
ads_calld_ = std::move(ads_calld);
|
203
233
|
Ref(DEBUG_LOCATION, "timer").release();
|
204
234
|
timer_pending_ = true;
|
@@ -209,6 +239,18 @@ class XdsClient::ChannelState::AdsCallState
|
|
209
239
|
}
|
210
240
|
|
211
241
|
void MaybeCancelTimer() {
|
242
|
+
// If the timer hasn't been started yet, make sure we don't start
|
243
|
+
// it later. This can happen if the last watch for an LDS or CDS
|
244
|
+
// resource is cancelled and then restarted, both while an ADS
|
245
|
+
// request for a different resource type is being sent (causing
|
246
|
+
// the unsubscription and then resubscription requests to be
|
247
|
+
// queued), and then we get a response for the LDS or CDS resource.
|
248
|
+
// In that case, we would call MaybeCancelTimer() when we receive the
|
249
|
+
// response and then MaybeStartTimer() when we finally send the new
|
250
|
+
// LDS or CDS request, thus causing the timer to fire when it shouldn't.
|
251
|
+
// For details, see https://github.com/grpc/grpc/issues/29583.
|
252
|
+
// TODO(roth): Find a way to write a test for this case.
|
253
|
+
timer_start_needed_ = false;
|
212
254
|
if (timer_pending_) {
|
213
255
|
grpc_timer_cancel(&timer_);
|
214
256
|
timer_pending_ = false;
|
@@ -217,7 +259,7 @@ class XdsClient::ChannelState::AdsCallState
|
|
217
259
|
|
218
260
|
private:
|
219
261
|
static void OnTimer(void* arg, grpc_error_handle error) {
|
220
|
-
|
262
|
+
ResourceTimer* self = static_cast<ResourceTimer*>(arg);
|
221
263
|
{
|
222
264
|
MutexLock lock(&self->ads_calld_->xds_client()->mu_);
|
223
265
|
self->OnTimerLocked(GRPC_ERROR_REF(error));
|
@@ -229,59 +271,34 @@ class XdsClient::ChannelState::AdsCallState
|
|
229
271
|
|
230
272
|
void OnTimerLocked(grpc_error_handle error)
|
231
273
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_) {
|
232
|
-
if (error
|
274
|
+
if (GRPC_ERROR_IS_NONE(error) && timer_pending_) {
|
233
275
|
timer_pending_ = false;
|
234
|
-
grpc_error_handle watcher_error =
|
235
|
-
GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
|
236
|
-
"timeout obtaining resource {type=%s name=%s} from xds server",
|
237
|
-
type_url_,
|
238
|
-
XdsApi::ConstructFullResourceName(name_.authority, type_url_,
|
239
|
-
name_.id)));
|
240
|
-
watcher_error = grpc_error_set_int(
|
241
|
-
watcher_error, GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
|
242
276
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
243
|
-
gpr_log(GPR_INFO,
|
244
|
-
|
277
|
+
gpr_log(GPR_INFO,
|
278
|
+
"[xds_client %p] xds server %s: timeout obtaining resource "
|
279
|
+
"{type=%s name=%s} from xds server",
|
280
|
+
ads_calld_->xds_client(),
|
281
|
+
ads_calld_->chand()->server_.server_uri.c_str(),
|
282
|
+
std::string(type_->type_url()).c_str(),
|
283
|
+
XdsClient::ConstructFullXdsResourceName(
|
284
|
+
name_.authority, type_->type_url(), name_.key)
|
285
|
+
.c_str());
|
245
286
|
}
|
246
287
|
auto& authority_state =
|
247
288
|
ads_calld_->xds_client()->authority_state_map_[name_.authority];
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
ads_calld_->xds_client(), state.watchers,
|
253
|
-
GRPC_ERROR_REF(watcher_error), DEBUG_LOCATION);
|
254
|
-
} else if (type_url_ == XdsApi::kRdsTypeUrl) {
|
255
|
-
RouteConfigState& state = authority_state.route_config_map[name_.id];
|
256
|
-
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
|
257
|
-
Notifier::ScheduleNotifyWatchersOnErrorInWorkSerializer(
|
258
|
-
ads_calld_->xds_client(), state.watchers,
|
259
|
-
GRPC_ERROR_REF(watcher_error), DEBUG_LOCATION);
|
260
|
-
} else if (type_url_ == XdsApi::kCdsTypeUrl) {
|
261
|
-
ClusterState& state = authority_state.cluster_map[name_.id];
|
262
|
-
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
|
263
|
-
Notifier::ScheduleNotifyWatchersOnErrorInWorkSerializer(
|
264
|
-
ads_calld_->xds_client(), state.watchers,
|
265
|
-
GRPC_ERROR_REF(watcher_error), DEBUG_LOCATION);
|
266
|
-
} else if (type_url_ == XdsApi::kEdsTypeUrl) {
|
267
|
-
EndpointState& state = authority_state.endpoint_map[name_.id];
|
268
|
-
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
|
269
|
-
Notifier::ScheduleNotifyWatchersOnErrorInWorkSerializer(
|
270
|
-
ads_calld_->xds_client(), state.watchers,
|
271
|
-
GRPC_ERROR_REF(watcher_error), DEBUG_LOCATION);
|
272
|
-
} else {
|
273
|
-
GPR_UNREACHABLE_CODE(return );
|
274
|
-
}
|
275
|
-
GRPC_ERROR_UNREF(watcher_error);
|
289
|
+
ResourceState& state = authority_state.resource_map[type_][name_.key];
|
290
|
+
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
|
291
|
+
ads_calld_->xds_client()->NotifyWatchersOnResourceDoesNotExist(
|
292
|
+
state.watchers);
|
276
293
|
}
|
277
294
|
GRPC_ERROR_UNREF(error);
|
278
295
|
}
|
279
296
|
|
280
|
-
const
|
281
|
-
const
|
297
|
+
const XdsResourceType* type_;
|
298
|
+
const XdsResourceName name_;
|
282
299
|
|
283
300
|
RefCountedPtr<AdsCallState> ads_calld_;
|
284
|
-
bool
|
301
|
+
bool timer_start_needed_ = true;
|
285
302
|
bool timer_pending_ = false;
|
286
303
|
grpc_timer timer_;
|
287
304
|
grpc_closure timer_callback_;
|
@@ -296,40 +313,11 @@ class XdsClient::ChannelState::AdsCallState
|
|
296
313
|
|
297
314
|
// Subscribed resources of this type.
|
298
315
|
std::map<std::string /*authority*/,
|
299
|
-
std::map<
|
316
|
+
std::map<XdsResourceKey, OrphanablePtr<ResourceTimer>>>
|
300
317
|
subscribed_resources;
|
301
318
|
};
|
302
319
|
|
303
|
-
void SendMessageLocked(const
|
304
|
-
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
305
|
-
|
306
|
-
void AcceptLdsUpdateLocked(
|
307
|
-
std::string version, grpc_millis update_time,
|
308
|
-
XdsApi::LdsUpdateMap lds_update_map,
|
309
|
-
const std::set<XdsApi::ResourceName>& resource_names_failed)
|
310
|
-
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
311
|
-
void AcceptRdsUpdateLocked(std::string version, grpc_millis update_time,
|
312
|
-
XdsApi::RdsUpdateMap rds_update_map)
|
313
|
-
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
314
|
-
void AcceptCdsUpdateLocked(
|
315
|
-
std::string version, grpc_millis update_time,
|
316
|
-
XdsApi::CdsUpdateMap cds_update_map,
|
317
|
-
const std::set<XdsApi::ResourceName>& resource_names_failed)
|
318
|
-
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
319
|
-
void AcceptEdsUpdateLocked(std::string version, grpc_millis update_time,
|
320
|
-
XdsApi::EdsUpdateMap eds_update_map)
|
321
|
-
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
322
|
-
|
323
|
-
template <typename StateMap>
|
324
|
-
void RejectAdsUpdateHelperLocked(const std::string& resource_name,
|
325
|
-
grpc_millis update_time,
|
326
|
-
const XdsApi::AdsParseResult& result,
|
327
|
-
const std::string& error_details,
|
328
|
-
StateMap* state_map)
|
329
|
-
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
330
|
-
|
331
|
-
void RejectAdsUpdateLocked(grpc_millis update_time,
|
332
|
-
const XdsApi::AdsParseResult& result)
|
320
|
+
void SendMessageLocked(const XdsResourceType* type)
|
333
321
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
334
322
|
|
335
323
|
static void OnRequestSent(void* arg, grpc_error_handle error);
|
@@ -344,9 +332,10 @@ class XdsClient::ChannelState::AdsCallState
|
|
344
332
|
|
345
333
|
bool IsCurrentCallOnChannel() const;
|
346
334
|
|
347
|
-
|
348
|
-
|
349
|
-
ResourceNamesForRequest(const
|
335
|
+
// Constructs a list of resource names of a given type for an ADS
|
336
|
+
// request. Also starts the timer for each resource if needed.
|
337
|
+
std::vector<std::string> ResourceNamesForRequest(const XdsResourceType* type)
|
338
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
350
339
|
|
351
340
|
// The owning RetryableCall<>.
|
352
341
|
RefCountedPtr<RetryableCall<AdsCallState>> parent_;
|
@@ -375,10 +364,10 @@ class XdsClient::ChannelState::AdsCallState
|
|
375
364
|
grpc_closure on_status_received_;
|
376
365
|
|
377
366
|
// Resource types for which requests need to be sent.
|
378
|
-
std::set<
|
367
|
+
std::set<const XdsResourceType*> buffered_requests_;
|
379
368
|
|
380
369
|
// State for each resource type.
|
381
|
-
std::map<
|
370
|
+
std::map<const XdsResourceType*, ResourceTypeState> state_map_;
|
382
371
|
};
|
383
372
|
|
384
373
|
// Contains an LRS call to the xds server.
|
@@ -402,7 +391,7 @@ class XdsClient::ChannelState::LrsCallState
|
|
402
391
|
// Reports client-side load stats according to a fixed interval.
|
403
392
|
class Reporter : public InternallyRefCounted<Reporter> {
|
404
393
|
public:
|
405
|
-
Reporter(RefCountedPtr<LrsCallState> parent,
|
394
|
+
Reporter(RefCountedPtr<LrsCallState> parent, Duration report_interval)
|
406
395
|
: parent_(std::move(parent)), report_interval_(report_interval) {
|
407
396
|
GRPC_CLOSURE_INIT(&on_next_report_timer_, OnNextReportTimer, this,
|
408
397
|
grpc_schedule_on_exec_ctx);
|
@@ -433,7 +422,7 @@ class XdsClient::ChannelState::LrsCallState
|
|
433
422
|
RefCountedPtr<LrsCallState> parent_;
|
434
423
|
|
435
424
|
// The load reporting state.
|
436
|
-
const
|
425
|
+
const Duration report_interval_;
|
437
426
|
bool last_report_counters_were_zero_ = false;
|
438
427
|
bool next_report_timer_callback_pending_ = false;
|
439
428
|
grpc_timer next_report_timer_;
|
@@ -480,7 +469,7 @@ class XdsClient::ChannelState::LrsCallState
|
|
480
469
|
// Load reporting state.
|
481
470
|
bool send_all_clusters_ = false;
|
482
471
|
std::set<std::string> cluster_names_; // Asked for by the LRS server.
|
483
|
-
|
472
|
+
Duration load_reporting_interval_;
|
484
473
|
OrphanablePtr<Reporter> reporter_;
|
485
474
|
};
|
486
475
|
|
@@ -503,12 +492,14 @@ class XdsClient::ChannelState::StateWatcher
|
|
503
492
|
new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
|
504
493
|
// In TRANSIENT_FAILURE. Notify all watchers of error.
|
505
494
|
gpr_log(GPR_INFO,
|
506
|
-
"[xds_client %p] xds channel in
|
507
|
-
"
|
508
|
-
parent_->xds_client(),
|
495
|
+
"[xds_client %p] xds channel for server %s in "
|
496
|
+
"state TRANSIENT_FAILURE: %s",
|
497
|
+
parent_->xds_client(), parent_->server_.server_uri.c_str(),
|
498
|
+
status.ToString().c_str());
|
509
499
|
parent_->xds_client_->NotifyOnErrorLocked(
|
510
|
-
|
511
|
-
"xds channel in TRANSIENT_FAILURE"
|
500
|
+
absl::UnavailableError(absl::StrCat(
|
501
|
+
"xds channel in TRANSIENT_FAILURE, connectivity error: ",
|
502
|
+
status.ToString())));
|
512
503
|
}
|
513
504
|
}
|
514
505
|
parent_->xds_client()->work_serializer_.DrainQueue();
|
@@ -526,10 +517,10 @@ namespace {
|
|
526
517
|
grpc_channel* CreateXdsChannel(grpc_channel_args* args,
|
527
518
|
const XdsBootstrap::XdsServer& server) {
|
528
519
|
RefCountedPtr<grpc_channel_credentials> channel_creds =
|
529
|
-
|
530
|
-
|
531
|
-
return
|
532
|
-
|
520
|
+
CoreConfiguration::Get().channel_creds_registry().CreateChannelCreds(
|
521
|
+
server.channel_creds_type, server.channel_creds_config);
|
522
|
+
return grpc_channel_create(server.server_uri.c_str(), channel_creds.get(),
|
523
|
+
args);
|
533
524
|
}
|
534
525
|
|
535
526
|
} // namespace
|
@@ -553,8 +544,8 @@ XdsClient::ChannelState::ChannelState(WeakRefCountedPtr<XdsClient> xds_client,
|
|
553
544
|
|
554
545
|
XdsClient::ChannelState::~ChannelState() {
|
555
546
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
556
|
-
gpr_log(GPR_INFO, "[xds_client %p]
|
557
|
-
this);
|
547
|
+
gpr_log(GPR_INFO, "[xds_client %p] destroying xds channel %p for server %s",
|
548
|
+
xds_client(), this, server_.server_uri.c_str());
|
558
549
|
}
|
559
550
|
grpc_channel_destroy(channel_);
|
560
551
|
xds_client_.reset(DEBUG_LOCATION, "ChannelState");
|
@@ -595,10 +586,29 @@ void XdsClient::ChannelState::MaybeStartLrsCall() {
|
|
595
586
|
WeakRef(DEBUG_LOCATION, "ChannelState+lrs")));
|
596
587
|
}
|
597
588
|
|
598
|
-
void XdsClient::ChannelState::
|
589
|
+
void XdsClient::ChannelState::StopLrsCallLocked() {
|
590
|
+
xds_client_->xds_load_report_server_map_.erase(server_);
|
591
|
+
lrs_calld_.reset();
|
592
|
+
}
|
593
|
+
|
594
|
+
namespace {
|
595
|
+
|
596
|
+
bool IsLameChannel(grpc_channel* channel) {
|
597
|
+
grpc_channel_element* elem =
|
598
|
+
grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel));
|
599
|
+
return elem->filter == &LameClientFilter::kFilter;
|
600
|
+
}
|
601
|
+
|
602
|
+
} // namespace
|
599
603
|
|
600
604
|
void XdsClient::ChannelState::StartConnectivityWatchLocked() {
|
601
|
-
|
605
|
+
if (IsLameChannel(channel_)) {
|
606
|
+
xds_client()->NotifyOnErrorLocked(
|
607
|
+
absl::UnavailableError("xds client has a lame channel"));
|
608
|
+
return;
|
609
|
+
}
|
610
|
+
ClientChannel* client_channel =
|
611
|
+
ClientChannel::GetFromChannel(Channel::FromC(channel_));
|
602
612
|
GPR_ASSERT(client_channel != nullptr);
|
603
613
|
watcher_ = new StateWatcher(WeakRef(DEBUG_LOCATION, "ChannelState+watch"));
|
604
614
|
client_channel->AddConnectivityWatcher(
|
@@ -607,13 +617,17 @@ void XdsClient::ChannelState::StartConnectivityWatchLocked() {
|
|
607
617
|
}
|
608
618
|
|
609
619
|
void XdsClient::ChannelState::CancelConnectivityWatchLocked() {
|
610
|
-
|
620
|
+
if (IsLameChannel(channel_)) {
|
621
|
+
return;
|
622
|
+
}
|
623
|
+
ClientChannel* client_channel =
|
624
|
+
ClientChannel::GetFromChannel(Channel::FromC(channel_));
|
611
625
|
GPR_ASSERT(client_channel != nullptr);
|
612
626
|
client_channel->RemoveConnectivityWatcher(watcher_);
|
613
627
|
}
|
614
628
|
|
615
|
-
void XdsClient::ChannelState::SubscribeLocked(
|
616
|
-
|
629
|
+
void XdsClient::ChannelState::SubscribeLocked(const XdsResourceType* type,
|
630
|
+
const XdsResourceName& name) {
|
617
631
|
if (ads_calld_ == nullptr) {
|
618
632
|
// Start the ADS call if this is the first request.
|
619
633
|
ads_calld_.reset(new RetryableCall<AdsCallState>(
|
@@ -627,16 +641,16 @@ void XdsClient::ChannelState::SubscribeLocked(
|
|
627
641
|
// because when the call is restarted it will resend all necessary requests.
|
628
642
|
if (ads_calld() == nullptr) return;
|
629
643
|
// Subscribe to this resource if the ADS call is active.
|
630
|
-
ads_calld()->SubscribeLocked(
|
644
|
+
ads_calld()->SubscribeLocked(type, name, /*delay_send=*/false);
|
631
645
|
}
|
632
646
|
|
633
|
-
void XdsClient::ChannelState::UnsubscribeLocked(
|
634
|
-
|
635
|
-
|
647
|
+
void XdsClient::ChannelState::UnsubscribeLocked(const XdsResourceType* type,
|
648
|
+
const XdsResourceName& name,
|
649
|
+
bool delay_unsubscription) {
|
636
650
|
if (ads_calld_ != nullptr) {
|
637
651
|
auto* calld = ads_calld_->calld();
|
638
652
|
if (calld != nullptr) {
|
639
|
-
calld->UnsubscribeLocked(
|
653
|
+
calld->UnsubscribeLocked(type, name, delay_unsubscription);
|
640
654
|
if (!calld->HasSubscribedResources()) {
|
641
655
|
ads_calld_.reset();
|
642
656
|
}
|
@@ -652,13 +666,13 @@ template <typename T>
|
|
652
666
|
XdsClient::ChannelState::RetryableCall<T>::RetryableCall(
|
653
667
|
WeakRefCountedPtr<ChannelState> chand)
|
654
668
|
: chand_(std::move(chand)),
|
655
|
-
backoff_(
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
669
|
+
backoff_(BackOff::Options()
|
670
|
+
.set_initial_backoff(Duration::Seconds(
|
671
|
+
GRPC_XDS_INITIAL_CONNECT_BACKOFF_SECONDS))
|
672
|
+
.set_multiplier(GRPC_XDS_RECONNECT_BACKOFF_MULTIPLIER)
|
673
|
+
.set_jitter(GRPC_XDS_RECONNECT_JITTER)
|
674
|
+
.set_max_backoff(Duration::Seconds(
|
675
|
+
GRPC_XDS_RECONNECT_MAX_BACKOFF_SECONDS))) {
|
662
676
|
// Closure Initialization
|
663
677
|
GRPC_CLOSURE_INIT(&on_retry_timer_, OnRetryTimer, this,
|
664
678
|
grpc_schedule_on_exec_ctx);
|
@@ -675,17 +689,11 @@ void XdsClient::ChannelState::RetryableCall<T>::Orphan() {
|
|
675
689
|
|
676
690
|
template <typename T>
|
677
691
|
void XdsClient::ChannelState::RetryableCall<T>::OnCallFinishedLocked() {
|
678
|
-
|
692
|
+
// If we saw a response on the current stream, reset backoff.
|
693
|
+
if (calld_->seen_response()) backoff_.Reset();
|
679
694
|
calld_.reset();
|
680
|
-
|
681
|
-
|
682
|
-
// call immediately.
|
683
|
-
backoff_.Reset();
|
684
|
-
StartNewCallLocked();
|
685
|
-
} else {
|
686
|
-
// If we failed to connect to the xds server, retry later.
|
687
|
-
StartRetryTimerLocked();
|
688
|
-
}
|
695
|
+
// Start retry timer.
|
696
|
+
StartRetryTimerLocked();
|
689
697
|
}
|
690
698
|
|
691
699
|
template <typename T>
|
@@ -694,10 +702,10 @@ void XdsClient::ChannelState::RetryableCall<T>::StartNewCallLocked() {
|
|
694
702
|
GPR_ASSERT(chand_->channel_ != nullptr);
|
695
703
|
GPR_ASSERT(calld_ == nullptr);
|
696
704
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
697
|
-
gpr_log(
|
698
|
-
|
699
|
-
|
700
|
-
|
705
|
+
gpr_log(
|
706
|
+
GPR_INFO,
|
707
|
+
"[xds_client %p] xds server %s: start new call from retryable call %p",
|
708
|
+
chand()->xds_client(), chand()->server_.server_uri.c_str(), this);
|
701
709
|
}
|
702
710
|
calld_ = MakeOrphanable<T>(
|
703
711
|
this->Ref(DEBUG_LOCATION, "RetryableCall+start_new_call"));
|
@@ -706,14 +714,15 @@ void XdsClient::ChannelState::RetryableCall<T>::StartNewCallLocked() {
|
|
706
714
|
template <typename T>
|
707
715
|
void XdsClient::ChannelState::RetryableCall<T>::StartRetryTimerLocked() {
|
708
716
|
if (shutting_down_) return;
|
709
|
-
const
|
717
|
+
const Timestamp next_attempt_time = backoff_.NextAttemptTime();
|
710
718
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
711
|
-
|
712
|
-
std::max(next_attempt_time - ExecCtx::Get()->Now(),
|
719
|
+
Duration timeout =
|
720
|
+
std::max(next_attempt_time - ExecCtx::Get()->Now(), Duration::Zero());
|
713
721
|
gpr_log(GPR_INFO,
|
714
|
-
"[xds_client %p]
|
722
|
+
"[xds_client %p] xds server %s: call attempt failed; "
|
715
723
|
"retry timer will fire in %" PRId64 "ms.",
|
716
|
-
chand()->xds_client(), chand(),
|
724
|
+
chand()->xds_client(), chand()->server_.server_uri.c_str(),
|
725
|
+
timeout.millis());
|
717
726
|
}
|
718
727
|
this->Ref(DEBUG_LOCATION, "RetryableCall+retry_timer_start").release();
|
719
728
|
grpc_timer_init(&retry_timer_, next_attempt_time, &on_retry_timer_);
|
@@ -735,18 +744,192 @@ template <typename T>
|
|
735
744
|
void XdsClient::ChannelState::RetryableCall<T>::OnRetryTimerLocked(
|
736
745
|
grpc_error_handle error) {
|
737
746
|
retry_timer_callback_pending_ = false;
|
738
|
-
if (!shutting_down_ && error
|
747
|
+
if (!shutting_down_ && GRPC_ERROR_IS_NONE(error)) {
|
739
748
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
740
|
-
gpr_log(
|
741
|
-
|
742
|
-
|
743
|
-
|
749
|
+
gpr_log(GPR_INFO,
|
750
|
+
"[xds_client %p] xds server %s: retry timer fired (retryable "
|
751
|
+
"call: %p)",
|
752
|
+
chand()->xds_client(), chand()->server_.server_uri.c_str(), this);
|
744
753
|
}
|
745
754
|
StartNewCallLocked();
|
746
755
|
}
|
747
756
|
GRPC_ERROR_UNREF(error);
|
748
757
|
}
|
749
758
|
|
759
|
+
//
|
760
|
+
// XdsClient::ChannelState::AdsCallState::AdsResponseParser
|
761
|
+
//
|
762
|
+
|
763
|
+
absl::Status XdsClient::ChannelState::AdsCallState::AdsResponseParser::
|
764
|
+
ProcessAdsResponseFields(AdsResponseFields fields) {
|
765
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
766
|
+
gpr_log(
|
767
|
+
GPR_INFO,
|
768
|
+
"[xds_client %p] xds server %s: received ADS response: type_url=%s, "
|
769
|
+
"version=%s, nonce=%s, num_resources=%" PRIuPTR,
|
770
|
+
ads_call_state_->xds_client(),
|
771
|
+
ads_call_state_->chand()->server_.server_uri.c_str(),
|
772
|
+
fields.type_url.c_str(), fields.version.c_str(), fields.nonce.c_str(),
|
773
|
+
fields.num_resources);
|
774
|
+
}
|
775
|
+
result_.type =
|
776
|
+
ads_call_state_->xds_client()->GetResourceTypeLocked(fields.type_url);
|
777
|
+
if (result_.type == nullptr) {
|
778
|
+
return absl::InvalidArgumentError(
|
779
|
+
absl::StrCat("unknown resource type ", fields.type_url));
|
780
|
+
}
|
781
|
+
result_.type_url = std::move(fields.type_url);
|
782
|
+
result_.version = std::move(fields.version);
|
783
|
+
result_.nonce = std::move(fields.nonce);
|
784
|
+
return absl::OkStatus();
|
785
|
+
}
|
786
|
+
|
787
|
+
namespace {
|
788
|
+
|
789
|
+
// Build a resource metadata struct for ADS result accepting methods and CSDS.
|
790
|
+
XdsApi::ResourceMetadata CreateResourceMetadataAcked(
|
791
|
+
std::string serialized_proto, std::string version, Timestamp update_time) {
|
792
|
+
XdsApi::ResourceMetadata resource_metadata;
|
793
|
+
resource_metadata.serialized_proto = std::move(serialized_proto);
|
794
|
+
resource_metadata.update_time = update_time;
|
795
|
+
resource_metadata.version = std::move(version);
|
796
|
+
resource_metadata.client_status = XdsApi::ResourceMetadata::ACKED;
|
797
|
+
return resource_metadata;
|
798
|
+
}
|
799
|
+
|
800
|
+
// Update resource_metadata for NACK.
|
801
|
+
void UpdateResourceMetadataNacked(const std::string& version,
|
802
|
+
const std::string& details,
|
803
|
+
Timestamp update_time,
|
804
|
+
XdsApi::ResourceMetadata* resource_metadata) {
|
805
|
+
resource_metadata->client_status = XdsApi::ResourceMetadata::NACKED;
|
806
|
+
resource_metadata->failed_version = version;
|
807
|
+
resource_metadata->failed_details = details;
|
808
|
+
resource_metadata->failed_update_time = update_time;
|
809
|
+
}
|
810
|
+
|
811
|
+
} // namespace
|
812
|
+
|
813
|
+
void XdsClient::ChannelState::AdsCallState::AdsResponseParser::ParseResource(
|
814
|
+
const XdsEncodingContext& context, size_t idx, absl::string_view type_url,
|
815
|
+
absl::string_view serialized_resource) {
|
816
|
+
// Check the type_url of the resource.
|
817
|
+
bool is_v2 = false;
|
818
|
+
if (!result_.type->IsType(type_url, &is_v2)) {
|
819
|
+
result_.errors.emplace_back(
|
820
|
+
absl::StrCat("resource index ", idx, ": incorrect resource type ",
|
821
|
+
type_url, " (should be ", result_.type_url, ")"));
|
822
|
+
return;
|
823
|
+
}
|
824
|
+
// Parse the resource.
|
825
|
+
absl::StatusOr<XdsResourceType::DecodeResult> result =
|
826
|
+
result_.type->Decode(context, serialized_resource, is_v2);
|
827
|
+
if (!result.ok()) {
|
828
|
+
result_.errors.emplace_back(
|
829
|
+
absl::StrCat("resource index ", idx, ": ", result.status().ToString()));
|
830
|
+
return;
|
831
|
+
}
|
832
|
+
// Check the resource name.
|
833
|
+
auto resource_name =
|
834
|
+
xds_client()->ParseXdsResourceName(result->name, result_.type);
|
835
|
+
if (!resource_name.ok()) {
|
836
|
+
result_.errors.emplace_back(absl::StrCat(
|
837
|
+
"resource index ", idx, ": Cannot parse xDS resource name \"",
|
838
|
+
result->name, "\""));
|
839
|
+
return;
|
840
|
+
}
|
841
|
+
// Cancel resource-does-not-exist timer, if needed.
|
842
|
+
auto timer_it = ads_call_state_->state_map_.find(result_.type);
|
843
|
+
if (timer_it != ads_call_state_->state_map_.end()) {
|
844
|
+
auto it =
|
845
|
+
timer_it->second.subscribed_resources.find(resource_name->authority);
|
846
|
+
if (it != timer_it->second.subscribed_resources.end()) {
|
847
|
+
auto res_it = it->second.find(resource_name->key);
|
848
|
+
if (res_it != it->second.end()) {
|
849
|
+
res_it->second->MaybeCancelTimer();
|
850
|
+
}
|
851
|
+
}
|
852
|
+
}
|
853
|
+
// Lookup the authority in the cache.
|
854
|
+
auto authority_it =
|
855
|
+
xds_client()->authority_state_map_.find(resource_name->authority);
|
856
|
+
if (authority_it == xds_client()->authority_state_map_.end()) {
|
857
|
+
return; // Skip resource -- we don't have a subscription for it.
|
858
|
+
}
|
859
|
+
// Found authority, so look up type.
|
860
|
+
AuthorityState& authority_state = authority_it->second;
|
861
|
+
auto type_it = authority_state.resource_map.find(result_.type);
|
862
|
+
if (type_it == authority_state.resource_map.end()) {
|
863
|
+
return; // Skip resource -- we don't have a subscription for it.
|
864
|
+
}
|
865
|
+
auto& type_map = type_it->second;
|
866
|
+
// Found type, so look up resource key.
|
867
|
+
auto it = type_map.find(resource_name->key);
|
868
|
+
if (it == type_map.end()) {
|
869
|
+
return; // Skip resource -- we don't have a subscription for it.
|
870
|
+
}
|
871
|
+
ResourceState& resource_state = it->second;
|
872
|
+
// If needed, record that we've seen this resource.
|
873
|
+
if (result_.type->AllResourcesRequiredInSotW()) {
|
874
|
+
result_.resources_seen[resource_name->authority].insert(resource_name->key);
|
875
|
+
}
|
876
|
+
// If we previously ignored the resource's deletion, log that we're
|
877
|
+
// now re-adding it.
|
878
|
+
if (resource_state.ignored_deletion) {
|
879
|
+
gpr_log(GPR_INFO,
|
880
|
+
"[xds_client %p] xds server %s: server returned new version of "
|
881
|
+
"resource for which we previously ignored a deletion: type %s "
|
882
|
+
"name %s",
|
883
|
+
xds_client(), ads_call_state_->chand()->server_.server_uri.c_str(),
|
884
|
+
std::string(type_url).c_str(), result->name.c_str());
|
885
|
+
resource_state.ignored_deletion = false;
|
886
|
+
}
|
887
|
+
// Update resource state based on whether the resource is valid.
|
888
|
+
if (!result->resource.ok()) {
|
889
|
+
result_.errors.emplace_back(absl::StrCat(
|
890
|
+
"resource index ", idx, ": ", result->name,
|
891
|
+
": validation error: ", result->resource.status().ToString()));
|
892
|
+
xds_client()->NotifyWatchersOnErrorLocked(
|
893
|
+
resource_state.watchers,
|
894
|
+
absl::UnavailableError(absl::StrCat(
|
895
|
+
"invalid resource: ", result->resource.status().ToString())));
|
896
|
+
UpdateResourceMetadataNacked(result_.version,
|
897
|
+
result->resource.status().ToString(),
|
898
|
+
update_time_, &resource_state.meta);
|
899
|
+
return;
|
900
|
+
}
|
901
|
+
// Resource is valid.
|
902
|
+
result_.have_valid_resources = true;
|
903
|
+
// If it didn't change, ignore it.
|
904
|
+
if (resource_state.resource != nullptr &&
|
905
|
+
result_.type->ResourcesEqual(resource_state.resource.get(),
|
906
|
+
result->resource->get())) {
|
907
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
908
|
+
gpr_log(GPR_INFO,
|
909
|
+
"[xds_client %p] %s resource %s identical to current, ignoring.",
|
910
|
+
xds_client(), result_.type_url.c_str(), result->name.c_str());
|
911
|
+
}
|
912
|
+
return;
|
913
|
+
}
|
914
|
+
// Update the resource state.
|
915
|
+
resource_state.resource = std::move(*result->resource);
|
916
|
+
resource_state.meta = CreateResourceMetadataAcked(
|
917
|
+
std::string(serialized_resource), result_.version, update_time_);
|
918
|
+
// Notify watchers.
|
919
|
+
auto& watchers_list = resource_state.watchers;
|
920
|
+
auto* value =
|
921
|
+
result_.type->CopyResource(resource_state.resource.get()).release();
|
922
|
+
xds_client()->work_serializer_.Schedule(
|
923
|
+
[watchers_list, value]()
|
924
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client()->work_serializer_) {
|
925
|
+
for (const auto& p : watchers_list) {
|
926
|
+
p.first->OnGenericResourceChanged(value);
|
927
|
+
}
|
928
|
+
delete value;
|
929
|
+
},
|
930
|
+
DEBUG_LOCATION);
|
931
|
+
}
|
932
|
+
|
750
933
|
//
|
751
934
|
// XdsClient::ChannelState::AdsCallState
|
752
935
|
//
|
@@ -763,14 +946,17 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
|
|
763
946
|
// the polling entities from client_channel.
|
764
947
|
GPR_ASSERT(xds_client() != nullptr);
|
765
948
|
// Create a call with the specified method name.
|
766
|
-
const
|
949
|
+
const char* method =
|
767
950
|
chand()->server_.ShouldUseV3()
|
768
|
-
?
|
769
|
-
|
951
|
+
? "/envoy.service.discovery.v3.AggregatedDiscoveryService/"
|
952
|
+
"StreamAggregatedResources"
|
953
|
+
: "/envoy.service.discovery.v2.AggregatedDiscoveryService/"
|
954
|
+
"StreamAggregatedResources";
|
770
955
|
call_ = grpc_channel_create_pollset_set_call(
|
771
956
|
chand()->channel_, nullptr, GRPC_PROPAGATE_DEFAULTS,
|
772
|
-
xds_client()->interested_parties_,
|
773
|
-
|
957
|
+
xds_client()->interested_parties_,
|
958
|
+
StaticSlice::FromStaticString(method).c_slice(), nullptr,
|
959
|
+
Timestamp::InfFuture(), nullptr);
|
774
960
|
GPR_ASSERT(call_ != nullptr);
|
775
961
|
// Init data associated with the call.
|
776
962
|
grpc_metadata_array_init(&initial_metadata_recv_);
|
@@ -778,9 +964,9 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
|
|
778
964
|
// Start the call.
|
779
965
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
780
966
|
gpr_log(GPR_INFO,
|
781
|
-
"[xds_client %p]
|
782
|
-
"call: %p)",
|
783
|
-
xds_client(), chand(), this, call_);
|
967
|
+
"[xds_client %p] xds server %s: starting ADS call "
|
968
|
+
"(calld: %p, call: %p)",
|
969
|
+
xds_client(), chand()->server_.server_uri.c_str(), this, call_);
|
784
970
|
}
|
785
971
|
// Create the ops.
|
786
972
|
grpc_call_error call_error;
|
@@ -804,23 +990,17 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
|
|
804
990
|
const std::string& authority = a.first;
|
805
991
|
// Skip authorities that are not using this xDS channel.
|
806
992
|
if (a.second.channel_state != chand()) continue;
|
807
|
-
for (const auto&
|
808
|
-
const
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
SubscribeLocked(XdsApi::kRdsTypeUrl, {authority, route_config_name});
|
814
|
-
}
|
815
|
-
for (const auto& c : a.second.cluster_map) {
|
816
|
-
const std::string& cluster_name = c.first;
|
817
|
-
SubscribeLocked(XdsApi::kCdsTypeUrl, {authority, cluster_name});
|
818
|
-
}
|
819
|
-
for (const auto& e : a.second.endpoint_map) {
|
820
|
-
const std::string& endpoint_name = e.first;
|
821
|
-
SubscribeLocked(XdsApi::kEdsTypeUrl, {authority, endpoint_name});
|
993
|
+
for (const auto& t : a.second.resource_map) {
|
994
|
+
const XdsResourceType* type = t.first;
|
995
|
+
for (const auto& r : t.second) {
|
996
|
+
const XdsResourceKey& resource_key = r.first;
|
997
|
+
SubscribeLocked(type, {authority, resource_key}, /*delay_send=*/true);
|
998
|
+
}
|
822
999
|
}
|
823
1000
|
}
|
1001
|
+
for (const auto& p : state_map_) {
|
1002
|
+
SendMessageLocked(p.first);
|
1003
|
+
}
|
824
1004
|
// Op: recv initial metadata.
|
825
1005
|
op = ops;
|
826
1006
|
op->op = GRPC_OP_RECV_INITIAL_METADATA;
|
@@ -883,33 +1063,29 @@ void XdsClient::ChannelState::AdsCallState::Orphan() {
|
|
883
1063
|
}
|
884
1064
|
|
885
1065
|
void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
|
886
|
-
const
|
1066
|
+
const XdsResourceType* type)
|
887
1067
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_) {
|
888
1068
|
// Buffer message sending if an existing message is in flight.
|
889
1069
|
if (send_message_payload_ != nullptr) {
|
890
|
-
buffered_requests_.insert(
|
1070
|
+
buffered_requests_.insert(type);
|
891
1071
|
return;
|
892
1072
|
}
|
893
|
-
auto& state = state_map_[
|
1073
|
+
auto& state = state_map_[type];
|
894
1074
|
grpc_slice request_payload_slice;
|
895
|
-
std::map<absl::string_view /*authority*/,
|
896
|
-
std::set<absl::string_view /*name*/>>
|
897
|
-
resource_map = ResourceNamesForRequest(type_url);
|
898
1075
|
request_payload_slice = xds_client()->api_.CreateAdsRequest(
|
899
|
-
chand()->server_,
|
900
|
-
chand()->
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
state_map_.erase(type_url);
|
905
|
-
}
|
1076
|
+
chand()->server_,
|
1077
|
+
chand()->server_.ShouldUseV3() ? type->type_url() : type->v2_type_url(),
|
1078
|
+
chand()->resource_type_version_map_[type], state.nonce,
|
1079
|
+
ResourceNamesForRequest(type), GRPC_ERROR_REF(state.error),
|
1080
|
+
!sent_initial_message_);
|
906
1081
|
sent_initial_message_ = true;
|
907
1082
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
908
1083
|
gpr_log(GPR_INFO,
|
909
|
-
"[xds_client %p] sending ADS request: type=%s
|
910
|
-
"error=%s",
|
911
|
-
xds_client(),
|
912
|
-
|
1084
|
+
"[xds_client %p] xds server %s: sending ADS request: type=%s "
|
1085
|
+
"version=%s nonce=%s error=%s",
|
1086
|
+
xds_client(), chand()->server_.server_uri.c_str(),
|
1087
|
+
std::string(type->type_url()).c_str(),
|
1088
|
+
chand()->resource_type_version_map_[type].c_str(),
|
913
1089
|
state.nonce.c_str(), grpc_error_std_string(state.error).c_str());
|
914
1090
|
}
|
915
1091
|
GRPC_ERROR_UNREF(state.error);
|
@@ -930,32 +1106,33 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
|
|
930
1106
|
grpc_call_start_batch_and_execute(call_, &op, 1, &on_request_sent_);
|
931
1107
|
if (GPR_UNLIKELY(call_error != GRPC_CALL_OK)) {
|
932
1108
|
gpr_log(GPR_ERROR,
|
933
|
-
"[xds_client %p]
|
934
|
-
|
1109
|
+
"[xds_client %p] xds server %s: error starting ADS send_message "
|
1110
|
+
"batch on calld=%p: call_error=%d",
|
1111
|
+
xds_client(), chand()->server_.server_uri.c_str(), this,
|
1112
|
+
call_error);
|
935
1113
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
936
1114
|
}
|
937
1115
|
}
|
938
1116
|
|
939
1117
|
void XdsClient::ChannelState::AdsCallState::SubscribeLocked(
|
940
|
-
const
|
941
|
-
auto& state =
|
942
|
-
state_map_[type_url].subscribed_resources[name.authority][name.id];
|
1118
|
+
const XdsResourceType* type, const XdsResourceName& name, bool delay_send) {
|
1119
|
+
auto& state = state_map_[type].subscribed_resources[name.authority][name.key];
|
943
1120
|
if (state == nullptr) {
|
944
|
-
state = MakeOrphanable<
|
945
|
-
SendMessageLocked(
|
1121
|
+
state = MakeOrphanable<ResourceTimer>(type, name);
|
1122
|
+
if (!delay_send) SendMessageLocked(type);
|
946
1123
|
}
|
947
1124
|
}
|
948
1125
|
|
949
1126
|
void XdsClient::ChannelState::AdsCallState::UnsubscribeLocked(
|
950
|
-
const
|
1127
|
+
const XdsResourceType* type, const XdsResourceName& name,
|
951
1128
|
bool delay_unsubscription) {
|
952
|
-
auto& type_state_map = state_map_[
|
1129
|
+
auto& type_state_map = state_map_[type];
|
953
1130
|
auto& authority_map = type_state_map.subscribed_resources[name.authority];
|
954
|
-
authority_map.erase(name.
|
1131
|
+
authority_map.erase(name.key);
|
955
1132
|
if (authority_map.empty()) {
|
956
1133
|
type_state_map.subscribed_resources.erase(name.authority);
|
957
1134
|
}
|
958
|
-
if (!delay_unsubscription) SendMessageLocked(
|
1135
|
+
if (!delay_unsubscription) SendMessageLocked(type);
|
959
1136
|
}
|
960
1137
|
|
961
1138
|
bool XdsClient::ChannelState::AdsCallState::HasSubscribedResources() const {
|
@@ -965,395 +1142,6 @@ bool XdsClient::ChannelState::AdsCallState::HasSubscribedResources() const {
|
|
965
1142
|
return false;
|
966
1143
|
}
|
967
1144
|
|
968
|
-
namespace {
|
969
|
-
|
970
|
-
// Build a resource metadata struct for ADS result accepting methods and CSDS.
|
971
|
-
XdsApi::ResourceMetadata CreateResourceMetadataAcked(
|
972
|
-
std::string serialized_proto, std::string version,
|
973
|
-
grpc_millis update_time) {
|
974
|
-
XdsApi::ResourceMetadata resource_metadata;
|
975
|
-
resource_metadata.serialized_proto = std::move(serialized_proto);
|
976
|
-
resource_metadata.update_time = update_time;
|
977
|
-
resource_metadata.version = std::move(version);
|
978
|
-
resource_metadata.client_status = XdsApi::ResourceMetadata::ACKED;
|
979
|
-
return resource_metadata;
|
980
|
-
}
|
981
|
-
|
982
|
-
} // namespace
|
983
|
-
|
984
|
-
void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdateLocked(
|
985
|
-
std::string version, grpc_millis update_time,
|
986
|
-
XdsApi::LdsUpdateMap lds_update_map,
|
987
|
-
const std::set<XdsApi::ResourceName>& resource_names_failed) {
|
988
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
989
|
-
gpr_log(GPR_INFO,
|
990
|
-
"[xds_client %p] LDS update received containing %" PRIuPTR
|
991
|
-
" resources",
|
992
|
-
xds_client(), lds_update_map.size());
|
993
|
-
}
|
994
|
-
auto& lds_state = state_map_[XdsApi::kLdsTypeUrl];
|
995
|
-
for (auto& p : lds_update_map) {
|
996
|
-
const XdsApi::ResourceName& name = p.first;
|
997
|
-
XdsApi::LdsUpdate& lds_update = p.second.resource;
|
998
|
-
auto it = lds_state.subscribed_resources.find(name.authority);
|
999
|
-
if (it != lds_state.subscribed_resources.end()) {
|
1000
|
-
auto res_it = it->second.find(name.id);
|
1001
|
-
if (res_it != it->second.end()) {
|
1002
|
-
res_it->second->MaybeCancelTimer();
|
1003
|
-
}
|
1004
|
-
}
|
1005
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1006
|
-
gpr_log(GPR_INFO, "[xds_client %p] LDS resource %s: %s", xds_client(),
|
1007
|
-
XdsApi::ConstructFullResourceName(name.authority,
|
1008
|
-
XdsApi::kLdsTypeUrl, name.id)
|
1009
|
-
.c_str(),
|
1010
|
-
lds_update.ToString().c_str());
|
1011
|
-
}
|
1012
|
-
ListenerState& listener_state = xds_client()
|
1013
|
-
->authority_state_map_[name.authority]
|
1014
|
-
.listener_map[name.id];
|
1015
|
-
// Ignore identical update.
|
1016
|
-
if (listener_state.update.has_value() &&
|
1017
|
-
*listener_state.update == lds_update) {
|
1018
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1019
|
-
gpr_log(GPR_INFO,
|
1020
|
-
"[xds_client %p] LDS update for %s identical to current, "
|
1021
|
-
"ignoring.",
|
1022
|
-
xds_client(),
|
1023
|
-
XdsApi::ConstructFullResourceName(name.authority,
|
1024
|
-
XdsApi::kLdsTypeUrl, name.id)
|
1025
|
-
.c_str());
|
1026
|
-
}
|
1027
|
-
continue;
|
1028
|
-
}
|
1029
|
-
// Update the listener state.
|
1030
|
-
listener_state.update = std::move(lds_update);
|
1031
|
-
listener_state.meta = CreateResourceMetadataAcked(
|
1032
|
-
std::move(p.second.serialized_proto), version, update_time);
|
1033
|
-
// Notify watchers.
|
1034
|
-
auto& watchers_list = listener_state.watchers;
|
1035
|
-
auto& value = listener_state.update.value();
|
1036
|
-
xds_client()->work_serializer_.Schedule(
|
1037
|
-
[watchers_list, value]()
|
1038
|
-
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client()->work_serializer_) {
|
1039
|
-
for (const auto& p : watchers_list) {
|
1040
|
-
p.first->OnListenerChanged(value);
|
1041
|
-
}
|
1042
|
-
},
|
1043
|
-
DEBUG_LOCATION);
|
1044
|
-
}
|
1045
|
-
// For invalid resources in the update, if they are already in the
|
1046
|
-
// cache, pretend that they are present in the update, so that we
|
1047
|
-
// don't incorrectly consider them deleted below.
|
1048
|
-
for (const auto& name : resource_names_failed) {
|
1049
|
-
auto& listener_map =
|
1050
|
-
xds_client()->authority_state_map_[name.authority].listener_map;
|
1051
|
-
auto it = listener_map.find(name.id);
|
1052
|
-
if (it != listener_map.end()) {
|
1053
|
-
auto& update = it->second.update;
|
1054
|
-
if (!update.has_value()) continue;
|
1055
|
-
lds_update_map[name];
|
1056
|
-
}
|
1057
|
-
}
|
1058
|
-
// For any subscribed resource that is not present in the update,
|
1059
|
-
// remove it from the cache and notify watchers that it does not exist.
|
1060
|
-
for (const auto& a : lds_state.subscribed_resources) {
|
1061
|
-
const std::string& authority_name = a.first;
|
1062
|
-
for (const auto& p : a.second) {
|
1063
|
-
const std::string& listener_name = p.first;
|
1064
|
-
if (lds_update_map.find({authority_name, listener_name}) ==
|
1065
|
-
lds_update_map.end()) {
|
1066
|
-
ListenerState& listener_state =
|
1067
|
-
xds_client()
|
1068
|
-
->authority_state_map_[authority_name]
|
1069
|
-
.listener_map[listener_name];
|
1070
|
-
// If the resource was newly requested but has not yet been received,
|
1071
|
-
// we don't want to generate an error for the watchers, because this LDS
|
1072
|
-
// response may be in reaction to an earlier request that did not yet
|
1073
|
-
// request the new resource, so its absence from the response does not
|
1074
|
-
// necessarily indicate that the resource does not exist.
|
1075
|
-
// For that case, we rely on the request timeout instead.
|
1076
|
-
if (!listener_state.update.has_value()) continue;
|
1077
|
-
listener_state.update.reset();
|
1078
|
-
Notifier::ScheduleNotifyWatchersOnResourceDoesNotExistInWorkSerializer(
|
1079
|
-
xds_client(), listener_state.watchers, DEBUG_LOCATION);
|
1080
|
-
}
|
1081
|
-
}
|
1082
|
-
}
|
1083
|
-
}
|
1084
|
-
|
1085
|
-
void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdateLocked(
|
1086
|
-
std::string version, grpc_millis update_time,
|
1087
|
-
XdsApi::RdsUpdateMap rds_update_map) {
|
1088
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1089
|
-
gpr_log(GPR_INFO,
|
1090
|
-
"[xds_client %p] RDS update received containing %" PRIuPTR
|
1091
|
-
" resources",
|
1092
|
-
xds_client(), rds_update_map.size());
|
1093
|
-
}
|
1094
|
-
auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
|
1095
|
-
for (auto& p : rds_update_map) {
|
1096
|
-
const XdsApi::ResourceName& name = p.first;
|
1097
|
-
XdsApi::RdsUpdate& rds_update = p.second.resource;
|
1098
|
-
auto it = rds_state.subscribed_resources.find(name.authority);
|
1099
|
-
if (it != rds_state.subscribed_resources.end()) {
|
1100
|
-
auto res_it = it->second.find(name.id);
|
1101
|
-
if (res_it != it->second.end()) {
|
1102
|
-
res_it->second->MaybeCancelTimer();
|
1103
|
-
}
|
1104
|
-
}
|
1105
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1106
|
-
gpr_log(GPR_INFO, "[xds_client %p] RDS resource:\n%s", xds_client(),
|
1107
|
-
rds_update.ToString().c_str());
|
1108
|
-
}
|
1109
|
-
RouteConfigState& route_config_state =
|
1110
|
-
xds_client()
|
1111
|
-
->authority_state_map_[name.authority]
|
1112
|
-
.route_config_map[name.id];
|
1113
|
-
// Ignore identical update.
|
1114
|
-
if (route_config_state.update.has_value() &&
|
1115
|
-
*route_config_state.update == rds_update) {
|
1116
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1117
|
-
gpr_log(GPR_INFO,
|
1118
|
-
"[xds_client %p] RDS resource identical to current, ignoring",
|
1119
|
-
xds_client());
|
1120
|
-
}
|
1121
|
-
continue;
|
1122
|
-
}
|
1123
|
-
// Update the cache.
|
1124
|
-
route_config_state.update = std::move(rds_update);
|
1125
|
-
route_config_state.meta = CreateResourceMetadataAcked(
|
1126
|
-
std::move(p.second.serialized_proto), version, update_time);
|
1127
|
-
// Notify all watchers.
|
1128
|
-
auto& watchers_list = route_config_state.watchers;
|
1129
|
-
auto& value = route_config_state.update.value();
|
1130
|
-
xds_client()->work_serializer_.Schedule(
|
1131
|
-
[watchers_list, value]()
|
1132
|
-
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client()->work_serializer_) {
|
1133
|
-
for (const auto& p : watchers_list) {
|
1134
|
-
p.first->OnRouteConfigChanged(value);
|
1135
|
-
}
|
1136
|
-
},
|
1137
|
-
DEBUG_LOCATION);
|
1138
|
-
}
|
1139
|
-
}
|
1140
|
-
|
1141
|
-
void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdateLocked(
|
1142
|
-
std::string version, grpc_millis update_time,
|
1143
|
-
XdsApi::CdsUpdateMap cds_update_map,
|
1144
|
-
const std::set<XdsApi::ResourceName>& resource_names_failed) {
|
1145
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1146
|
-
gpr_log(GPR_INFO,
|
1147
|
-
"[xds_client %p] CDS update received containing %" PRIuPTR
|
1148
|
-
" resources",
|
1149
|
-
xds_client(), cds_update_map.size());
|
1150
|
-
}
|
1151
|
-
auto& cds_state = state_map_[XdsApi::kCdsTypeUrl];
|
1152
|
-
for (auto& p : cds_update_map) {
|
1153
|
-
const XdsApi::ResourceName& name = p.first;
|
1154
|
-
XdsApi::CdsUpdate& cds_update = p.second.resource;
|
1155
|
-
auto it = cds_state.subscribed_resources.find(name.authority);
|
1156
|
-
if (it != cds_state.subscribed_resources.end()) {
|
1157
|
-
auto res_it = it->second.find(name.id);
|
1158
|
-
if (res_it != it->second.end()) {
|
1159
|
-
res_it->second->MaybeCancelTimer();
|
1160
|
-
}
|
1161
|
-
}
|
1162
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1163
|
-
gpr_log(GPR_INFO, "[xds_client %p] cluster=%s: %s", xds_client(),
|
1164
|
-
XdsApi::ConstructFullResourceName(name.authority,
|
1165
|
-
XdsApi::kCdsTypeUrl, name.id)
|
1166
|
-
.c_str(),
|
1167
|
-
cds_update.ToString().c_str());
|
1168
|
-
}
|
1169
|
-
ClusterState& cluster_state =
|
1170
|
-
xds_client()->authority_state_map_[name.authority].cluster_map[name.id];
|
1171
|
-
// Ignore identical update.
|
1172
|
-
if (cluster_state.update.has_value() &&
|
1173
|
-
*cluster_state.update == cds_update) {
|
1174
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1175
|
-
gpr_log(GPR_INFO,
|
1176
|
-
"[xds_client %p] CDS update identical to current, ignoring.",
|
1177
|
-
xds_client());
|
1178
|
-
}
|
1179
|
-
continue;
|
1180
|
-
}
|
1181
|
-
// Update the cluster state.
|
1182
|
-
cluster_state.update = std::move(cds_update);
|
1183
|
-
cluster_state.meta = CreateResourceMetadataAcked(
|
1184
|
-
std::move(p.second.serialized_proto), version, update_time);
|
1185
|
-
// Notify all watchers.
|
1186
|
-
auto& watchers_list = cluster_state.watchers;
|
1187
|
-
auto& value = cluster_state.update.value();
|
1188
|
-
xds_client()->work_serializer_.Schedule(
|
1189
|
-
[watchers_list, value]()
|
1190
|
-
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client()->work_serializer_) {
|
1191
|
-
for (const auto& p : watchers_list) {
|
1192
|
-
p.first->OnClusterChanged(value);
|
1193
|
-
}
|
1194
|
-
},
|
1195
|
-
DEBUG_LOCATION);
|
1196
|
-
}
|
1197
|
-
// For invalid resources in the update, if they are already in the
|
1198
|
-
// cache, pretend that they are present in the update, so that we
|
1199
|
-
// don't incorrectly consider them deleted below.
|
1200
|
-
for (const auto& name : resource_names_failed) {
|
1201
|
-
auto& cluster_map =
|
1202
|
-
xds_client()->authority_state_map_[name.authority].cluster_map;
|
1203
|
-
auto it = cluster_map.find(name.id);
|
1204
|
-
if (it != cluster_map.end()) {
|
1205
|
-
auto& update = it->second.update;
|
1206
|
-
if (!update.has_value()) continue;
|
1207
|
-
cds_update_map[name];
|
1208
|
-
}
|
1209
|
-
}
|
1210
|
-
// For any subscribed resource that is not present in the update,
|
1211
|
-
// remove it from the cache and notify watchers that it does not exist.
|
1212
|
-
for (const auto& a : cds_state.subscribed_resources) {
|
1213
|
-
const std::string& authority = a.first;
|
1214
|
-
for (const auto& p : a.second) {
|
1215
|
-
const std::string& cluster_name = p.first;
|
1216
|
-
if (cds_update_map.find({authority, cluster_name}) ==
|
1217
|
-
cds_update_map.end()) {
|
1218
|
-
ClusterState& cluster_state = xds_client()
|
1219
|
-
->authority_state_map_[authority]
|
1220
|
-
.cluster_map[cluster_name];
|
1221
|
-
// If the resource was newly requested but has not yet been received,
|
1222
|
-
// we don't want to generate an error for the watchers, because this CDS
|
1223
|
-
// response may be in reaction to an earlier request that did not yet
|
1224
|
-
// request the new resource, so its absence from the response does not
|
1225
|
-
// necessarily indicate that the resource does not exist.
|
1226
|
-
// For that case, we rely on the request timeout instead.
|
1227
|
-
if (!cluster_state.update.has_value()) continue;
|
1228
|
-
cluster_state.update.reset();
|
1229
|
-
Notifier::ScheduleNotifyWatchersOnResourceDoesNotExistInWorkSerializer(
|
1230
|
-
xds_client(), cluster_state.watchers, DEBUG_LOCATION);
|
1231
|
-
}
|
1232
|
-
}
|
1233
|
-
}
|
1234
|
-
}
|
1235
|
-
|
1236
|
-
void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdateLocked(
|
1237
|
-
std::string version, grpc_millis update_time,
|
1238
|
-
XdsApi::EdsUpdateMap eds_update_map) {
|
1239
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1240
|
-
gpr_log(GPR_INFO,
|
1241
|
-
"[xds_client %p] EDS update received containing %" PRIuPTR
|
1242
|
-
" resources",
|
1243
|
-
xds_client(), eds_update_map.size());
|
1244
|
-
}
|
1245
|
-
auto& eds_state = state_map_[XdsApi::kEdsTypeUrl];
|
1246
|
-
for (auto& p : eds_update_map) {
|
1247
|
-
const XdsApi::ResourceName& name = p.first;
|
1248
|
-
XdsApi::EdsUpdate& eds_update = p.second.resource;
|
1249
|
-
auto it = eds_state.subscribed_resources.find(name.authority);
|
1250
|
-
if (it != eds_state.subscribed_resources.end()) {
|
1251
|
-
auto res_it = it->second.find(name.id);
|
1252
|
-
if (res_it != it->second.end()) {
|
1253
|
-
res_it->second->MaybeCancelTimer();
|
1254
|
-
}
|
1255
|
-
}
|
1256
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1257
|
-
gpr_log(GPR_INFO, "[xds_client %p] EDS resource %s: %s", xds_client(),
|
1258
|
-
XdsApi::ConstructFullResourceName(name.authority,
|
1259
|
-
XdsApi::kCdsTypeUrl, name.id)
|
1260
|
-
.c_str(),
|
1261
|
-
eds_update.ToString().c_str());
|
1262
|
-
}
|
1263
|
-
EndpointState& endpoint_state = xds_client()
|
1264
|
-
->authority_state_map_[name.authority]
|
1265
|
-
.endpoint_map[name.id];
|
1266
|
-
// Ignore identical update.
|
1267
|
-
if (endpoint_state.update.has_value() &&
|
1268
|
-
*endpoint_state.update == eds_update) {
|
1269
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1270
|
-
gpr_log(GPR_INFO,
|
1271
|
-
"[xds_client %p] EDS update identical to current, ignoring.",
|
1272
|
-
xds_client());
|
1273
|
-
}
|
1274
|
-
continue;
|
1275
|
-
}
|
1276
|
-
// Update the cluster state.
|
1277
|
-
endpoint_state.update = std::move(eds_update);
|
1278
|
-
endpoint_state.meta = CreateResourceMetadataAcked(
|
1279
|
-
std::move(p.second.serialized_proto), version, update_time);
|
1280
|
-
// Notify all watchers.
|
1281
|
-
auto& watchers_list = endpoint_state.watchers;
|
1282
|
-
auto& value = endpoint_state.update.value();
|
1283
|
-
xds_client()->work_serializer_.Schedule(
|
1284
|
-
[watchers_list, value]()
|
1285
|
-
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client()->work_serializer_) {
|
1286
|
-
for (const auto& p : watchers_list) {
|
1287
|
-
p.first->OnEndpointChanged(value);
|
1288
|
-
}
|
1289
|
-
},
|
1290
|
-
DEBUG_LOCATION);
|
1291
|
-
}
|
1292
|
-
}
|
1293
|
-
|
1294
|
-
namespace {
|
1295
|
-
|
1296
|
-
// Update resource_metadata for NACK.
|
1297
|
-
void UpdateResourceMetadataNacked(const std::string& version,
|
1298
|
-
const std::string& details,
|
1299
|
-
grpc_millis update_time,
|
1300
|
-
XdsApi::ResourceMetadata* resource_metadata) {
|
1301
|
-
resource_metadata->client_status = XdsApi::ResourceMetadata::NACKED;
|
1302
|
-
resource_metadata->failed_version = version;
|
1303
|
-
resource_metadata->failed_details = details;
|
1304
|
-
resource_metadata->failed_update_time = update_time;
|
1305
|
-
}
|
1306
|
-
|
1307
|
-
} // namespace
|
1308
|
-
|
1309
|
-
template <typename StateMap>
|
1310
|
-
void XdsClient::ChannelState::AdsCallState::RejectAdsUpdateHelperLocked(
|
1311
|
-
const std::string& resource_name, grpc_millis update_time,
|
1312
|
-
const XdsApi::AdsParseResult& result, const std::string& error_details,
|
1313
|
-
StateMap* state_map) {
|
1314
|
-
auto it = state_map->find(resource_name);
|
1315
|
-
if (it == state_map->end()) return;
|
1316
|
-
auto& state = it->second;
|
1317
|
-
Notifier::ScheduleNotifyWatchersOnErrorInWorkSerializer(
|
1318
|
-
xds_client(), state.watchers, GRPC_ERROR_REF(result.parse_error),
|
1319
|
-
DEBUG_LOCATION);
|
1320
|
-
UpdateResourceMetadataNacked(result.version, error_details, update_time,
|
1321
|
-
&state.meta);
|
1322
|
-
}
|
1323
|
-
|
1324
|
-
void XdsClient::ChannelState::AdsCallState::RejectAdsUpdateLocked(
|
1325
|
-
grpc_millis update_time, const XdsApi::AdsParseResult& result) {
|
1326
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1327
|
-
gpr_log(GPR_INFO,
|
1328
|
-
"[xds_client %p] %s update NACKed containing %" PRIuPTR
|
1329
|
-
" invalid resources",
|
1330
|
-
xds_client(), result.type_url.c_str(),
|
1331
|
-
result.resource_names_failed.size());
|
1332
|
-
}
|
1333
|
-
std::string details = grpc_error_std_string(result.parse_error);
|
1334
|
-
for (auto& resource : result.resource_names_failed) {
|
1335
|
-
auto authority_it =
|
1336
|
-
xds_client()->authority_state_map_.find(resource.authority);
|
1337
|
-
if (authority_it == xds_client()->authority_state_map_.end()) continue;
|
1338
|
-
AuthorityState& authority_state = authority_it->second;
|
1339
|
-
if (result.type_url == XdsApi::kLdsTypeUrl) {
|
1340
|
-
RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
|
1341
|
-
&authority_state.listener_map);
|
1342
|
-
} else if (result.type_url == XdsApi::kRdsTypeUrl) {
|
1343
|
-
RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
|
1344
|
-
&authority_state.route_config_map);
|
1345
|
-
} else if (result.type_url == XdsApi::kCdsTypeUrl) {
|
1346
|
-
RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
|
1347
|
-
&authority_state.cluster_map);
|
1348
|
-
} else if (result.type_url == XdsApi::kEdsTypeUrl) {
|
1349
|
-
RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
|
1350
|
-
&authority_state.endpoint_map);
|
1351
|
-
} else {
|
1352
|
-
GPR_ASSERT(0);
|
1353
|
-
}
|
1354
|
-
}
|
1355
|
-
}
|
1356
|
-
|
1357
1145
|
void XdsClient::ChannelState::AdsCallState::OnRequestSent(
|
1358
1146
|
void* arg, grpc_error_handle error) {
|
1359
1147
|
AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
|
@@ -1366,7 +1154,7 @@ void XdsClient::ChannelState::AdsCallState::OnRequestSent(
|
|
1366
1154
|
|
1367
1155
|
void XdsClient::ChannelState::AdsCallState::OnRequestSentLocked(
|
1368
1156
|
grpc_error_handle error) {
|
1369
|
-
if (IsCurrentCallOnChannel() && error
|
1157
|
+
if (IsCurrentCallOnChannel() && GRPC_ERROR_IS_NONE(error)) {
|
1370
1158
|
// Clean up the sent message.
|
1371
1159
|
grpc_byte_buffer_destroy(send_message_payload_);
|
1372
1160
|
send_message_payload_ = nullptr;
|
@@ -1413,63 +1201,89 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
|
|
1413
1201
|
grpc_byte_buffer_destroy(recv_message_payload_);
|
1414
1202
|
recv_message_payload_ = nullptr;
|
1415
1203
|
// Parse and validate the response.
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1419
|
-
ResourceNamesForRequest(XdsApi::kRdsTypeUrl),
|
1420
|
-
ResourceNamesForRequest(XdsApi::kCdsTypeUrl),
|
1421
|
-
ResourceNamesForRequest(XdsApi::kEdsTypeUrl));
|
1204
|
+
AdsResponseParser parser(this);
|
1205
|
+
absl::Status status = xds_client()->api_.ParseAdsResponse(
|
1206
|
+
chand()->server_, response_slice, &parser);
|
1422
1207
|
grpc_slice_unref_internal(response_slice);
|
1423
|
-
if (
|
1208
|
+
if (!status.ok()) {
|
1424
1209
|
// Ignore unparsable response.
|
1425
1210
|
gpr_log(GPR_ERROR,
|
1426
|
-
"[xds_client %p]
|
1427
|
-
|
1428
|
-
|
1211
|
+
"[xds_client %p] xds server %s: error parsing ADS response (%s) "
|
1212
|
+
"-- ignoring",
|
1213
|
+
xds_client(), chand()->server_.server_uri.c_str(),
|
1214
|
+
status.ToString().c_str());
|
1429
1215
|
} else {
|
1430
|
-
|
1216
|
+
seen_response_ = true;
|
1217
|
+
AdsResponseParser::Result result = parser.TakeResult();
|
1431
1218
|
// Update nonce.
|
1432
|
-
auto& state = state_map_[result.
|
1433
|
-
state.nonce =
|
1434
|
-
// If we got an error, we'll NACK the update.
|
1435
|
-
if (result.
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
GRPC_STATUS_UNAVAILABLE);
|
1219
|
+
auto& state = state_map_[result.type];
|
1220
|
+
state.nonce = result.nonce;
|
1221
|
+
// If we got an error, set state.error so that we'll NACK the update.
|
1222
|
+
if (!result.errors.empty()) {
|
1223
|
+
std::string error = absl::StrJoin(result.errors, "; ");
|
1224
|
+
gpr_log(
|
1225
|
+
GPR_ERROR,
|
1226
|
+
"[xds_client %p] xds server %s: ADS response invalid for resource "
|
1227
|
+
"type %s version %s, will NACK: nonce=%s error=%s",
|
1228
|
+
xds_client(), chand()->server_.server_uri.c_str(),
|
1229
|
+
result.type_url.c_str(), result.version.c_str(), state.nonce.c_str(),
|
1230
|
+
error.c_str());
|
1445
1231
|
GRPC_ERROR_UNREF(state.error);
|
1446
|
-
state.error =
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
if (result.
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1232
|
+
state.error = grpc_error_set_int(GRPC_ERROR_CREATE_FROM_CPP_STRING(error),
|
1233
|
+
GRPC_ERROR_INT_GRPC_STATUS,
|
1234
|
+
GRPC_STATUS_UNAVAILABLE);
|
1235
|
+
}
|
1236
|
+
// Delete resources not seen in update if needed.
|
1237
|
+
if (result.type->AllResourcesRequiredInSotW()) {
|
1238
|
+
for (auto& a : xds_client()->authority_state_map_) {
|
1239
|
+
const std::string& authority = a.first;
|
1240
|
+
AuthorityState& authority_state = a.second;
|
1241
|
+
// Skip authorities that are not using this xDS channel.
|
1242
|
+
if (authority_state.channel_state != chand()) continue;
|
1243
|
+
auto seen_authority_it = result.resources_seen.find(authority);
|
1244
|
+
// Find this resource type.
|
1245
|
+
auto type_it = authority_state.resource_map.find(result.type);
|
1246
|
+
if (type_it == authority_state.resource_map.end()) continue;
|
1247
|
+
// Iterate over resource ids.
|
1248
|
+
for (auto& r : type_it->second) {
|
1249
|
+
const XdsResourceKey& resource_key = r.first;
|
1250
|
+
ResourceState& resource_state = r.second;
|
1251
|
+
if (seen_authority_it == result.resources_seen.end() ||
|
1252
|
+
seen_authority_it->second.find(resource_key) ==
|
1253
|
+
seen_authority_it->second.end()) {
|
1254
|
+
// If the resource was newly requested but has not yet been
|
1255
|
+
// received, we don't want to generate an error for the watchers,
|
1256
|
+
// because this ADS response may be in reaction to an earlier
|
1257
|
+
// request that did not yet request the new resource, so its absence
|
1258
|
+
// from the response does not necessarily indicate that the resource
|
1259
|
+
// does not exist. For that case, we rely on the request timeout
|
1260
|
+
// instead.
|
1261
|
+
if (resource_state.resource == nullptr) continue;
|
1262
|
+
if (chand()->server_.IgnoreResourceDeletion()) {
|
1263
|
+
if (!resource_state.ignored_deletion) {
|
1264
|
+
gpr_log(GPR_ERROR,
|
1265
|
+
"[xds_client %p] xds server %s: ignoring deletion "
|
1266
|
+
"for resource type %s name %s",
|
1267
|
+
xds_client(), chand()->server_.server_uri.c_str(),
|
1268
|
+
result.type_url.c_str(),
|
1269
|
+
XdsClient::ConstructFullXdsResourceName(
|
1270
|
+
authority, result.type_url.c_str(), resource_key)
|
1271
|
+
.c_str());
|
1272
|
+
resource_state.ignored_deletion = true;
|
1273
|
+
}
|
1274
|
+
} else {
|
1275
|
+
resource_state.resource.reset();
|
1276
|
+
xds_client()->NotifyWatchersOnResourceDoesNotExist(
|
1277
|
+
resource_state.watchers);
|
1278
|
+
}
|
1279
|
+
}
|
1280
|
+
}
|
1281
|
+
}
|
1469
1282
|
}
|
1470
|
-
|
1471
|
-
|
1472
|
-
chand()->resource_type_version_map_[result.
|
1283
|
+
// If we had valid resources, update the version.
|
1284
|
+
if (result.have_valid_resources) {
|
1285
|
+
chand()->resource_type_version_map_[result.type] =
|
1286
|
+
std::move(result.version);
|
1473
1287
|
// Start load reporting if needed.
|
1474
1288
|
auto& lrs_call = chand()->lrs_calld_;
|
1475
1289
|
if (lrs_call != nullptr) {
|
@@ -1478,7 +1292,7 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
|
|
1478
1292
|
}
|
1479
1293
|
}
|
1480
1294
|
// Send ACK or NACK.
|
1481
|
-
SendMessageLocked(result.
|
1295
|
+
SendMessageLocked(result.type);
|
1482
1296
|
}
|
1483
1297
|
if (xds_client()->shutting_down_) return true;
|
1484
1298
|
// Keep listening for updates.
|
@@ -1512,9 +1326,11 @@ void XdsClient::ChannelState::AdsCallState::OnStatusReceivedLocked(
|
|
1512
1326
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1513
1327
|
char* status_details = grpc_slice_to_c_string(status_details_);
|
1514
1328
|
gpr_log(GPR_INFO,
|
1515
|
-
"[xds_client %p] ADS call status received
|
1516
|
-
"
|
1517
|
-
|
1329
|
+
"[xds_client %p] xds server %s: ADS call status received "
|
1330
|
+
"(chand=%p, ads_calld=%p, call=%p): "
|
1331
|
+
"status=%d, details='%s', error='%s'",
|
1332
|
+
xds_client(), chand()->server_.server_uri.c_str(), chand(), this,
|
1333
|
+
call_, status_code_, status_details,
|
1518
1334
|
grpc_error_std_string(error).c_str());
|
1519
1335
|
gpr_free(status_details);
|
1520
1336
|
}
|
@@ -1523,8 +1339,11 @@ void XdsClient::ChannelState::AdsCallState::OnStatusReceivedLocked(
|
|
1523
1339
|
// Try to restart the call.
|
1524
1340
|
parent_->OnCallFinishedLocked();
|
1525
1341
|
// Send error to all watchers.
|
1526
|
-
xds_client()->NotifyOnErrorLocked(
|
1527
|
-
|
1342
|
+
xds_client()->NotifyOnErrorLocked(absl::UnavailableError(absl::StrFormat(
|
1343
|
+
"xDS call failed: xDS server: %s, ADS call status code=%d, "
|
1344
|
+
"details='%s', error='%s'",
|
1345
|
+
chand()->server_.server_uri, status_code_,
|
1346
|
+
StringViewFromSlice(status_details_), grpc_error_std_string(error))));
|
1528
1347
|
}
|
1529
1348
|
GRPC_ERROR_UNREF(error);
|
1530
1349
|
}
|
@@ -1536,23 +1355,24 @@ bool XdsClient::ChannelState::AdsCallState::IsCurrentCallOnChannel() const {
|
|
1536
1355
|
return this == chand()->ads_calld_->calld();
|
1537
1356
|
}
|
1538
1357
|
|
1539
|
-
std::
|
1358
|
+
std::vector<std::string>
|
1540
1359
|
XdsClient::ChannelState::AdsCallState::ResourceNamesForRequest(
|
1541
|
-
const
|
1542
|
-
std::
|
1543
|
-
|
1544
|
-
resource_map;
|
1545
|
-
auto it = state_map_.find(type_url);
|
1360
|
+
const XdsResourceType* type) {
|
1361
|
+
std::vector<std::string> resource_names;
|
1362
|
+
auto it = state_map_.find(type);
|
1546
1363
|
if (it != state_map_.end()) {
|
1547
1364
|
for (auto& a : it->second.subscribed_resources) {
|
1365
|
+
const std::string& authority = a.first;
|
1548
1366
|
for (auto& p : a.second) {
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1367
|
+
const XdsResourceKey& resource_key = p.first;
|
1368
|
+
resource_names.emplace_back(XdsClient::ConstructFullXdsResourceName(
|
1369
|
+
authority, type->type_url(), resource_key));
|
1370
|
+
OrphanablePtr<ResourceTimer>& resource_timer = p.second;
|
1371
|
+
resource_timer->MaybeStartTimer(Ref(DEBUG_LOCATION, "ResourceTimer"));
|
1552
1372
|
}
|
1553
1373
|
}
|
1554
1374
|
}
|
1555
|
-
return
|
1375
|
+
return resource_names;
|
1556
1376
|
}
|
1557
1377
|
|
1558
1378
|
//
|
@@ -1567,7 +1387,7 @@ void XdsClient::ChannelState::LrsCallState::Reporter::Orphan() {
|
|
1567
1387
|
|
1568
1388
|
void XdsClient::ChannelState::LrsCallState::Reporter::
|
1569
1389
|
ScheduleNextReportLocked() {
|
1570
|
-
const
|
1390
|
+
const Timestamp next_report_time = ExecCtx::Get()->Now() + report_interval_;
|
1571
1391
|
grpc_timer_init(&next_report_timer_, next_report_time,
|
1572
1392
|
&on_next_report_timer_);
|
1573
1393
|
next_report_timer_callback_pending_ = true;
|
@@ -1587,7 +1407,7 @@ void XdsClient::ChannelState::LrsCallState::Reporter::OnNextReportTimer(
|
|
1587
1407
|
bool XdsClient::ChannelState::LrsCallState::Reporter::OnNextReportTimerLocked(
|
1588
1408
|
grpc_error_handle error) {
|
1589
1409
|
next_report_timer_callback_pending_ = false;
|
1590
|
-
if (error
|
1410
|
+
if (!GRPC_ERROR_IS_NONE(error) || !IsCurrentReporterOnCall()) {
|
1591
1411
|
GRPC_ERROR_UNREF(error);
|
1592
1412
|
return true;
|
1593
1413
|
}
|
@@ -1613,15 +1433,19 @@ bool LoadReportCountersAreZero(const XdsApi::ClusterLoadReportMap& snapshot) {
|
|
1613
1433
|
bool XdsClient::ChannelState::LrsCallState::Reporter::SendReportLocked() {
|
1614
1434
|
// Construct snapshot from all reported stats.
|
1615
1435
|
XdsApi::ClusterLoadReportMap snapshot =
|
1616
|
-
xds_client()->BuildLoadReportSnapshotLocked(parent_->
|
1436
|
+
xds_client()->BuildLoadReportSnapshotLocked(parent_->chand()->server_,
|
1437
|
+
parent_->send_all_clusters_,
|
1617
1438
|
parent_->cluster_names_);
|
1618
1439
|
// Skip client load report if the counters were all zero in the last
|
1619
1440
|
// report and they are still zero in this one.
|
1620
1441
|
const bool old_val = last_report_counters_were_zero_;
|
1621
1442
|
last_report_counters_were_zero_ = LoadReportCountersAreZero(snapshot);
|
1622
1443
|
if (old_val && last_report_counters_were_zero_) {
|
1623
|
-
|
1624
|
-
|
1444
|
+
auto it = xds_client()->xds_load_report_server_map_.find(
|
1445
|
+
parent_->chand()->server_);
|
1446
|
+
if (it == xds_client()->xds_load_report_server_map_.end() ||
|
1447
|
+
it->second.load_report_map.empty()) {
|
1448
|
+
it->second.channel_state->StopLrsCallLocked();
|
1625
1449
|
return true;
|
1626
1450
|
}
|
1627
1451
|
ScheduleNextReportLocked();
|
@@ -1642,8 +1466,10 @@ bool XdsClient::ChannelState::LrsCallState::Reporter::SendReportLocked() {
|
|
1642
1466
|
parent_->call_, &op, 1, &on_report_done_);
|
1643
1467
|
if (GPR_UNLIKELY(call_error != GRPC_CALL_OK)) {
|
1644
1468
|
gpr_log(GPR_ERROR,
|
1645
|
-
"[xds_client %p]
|
1646
|
-
|
1469
|
+
"[xds_client %p] xds server %s: error starting LRS send_message "
|
1470
|
+
"batch on calld=%p: call_error=%d",
|
1471
|
+
xds_client(), parent_->chand()->server_.server_uri.c_str(), this,
|
1472
|
+
call_error);
|
1647
1473
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
1648
1474
|
}
|
1649
1475
|
return false;
|
@@ -1665,12 +1491,15 @@ bool XdsClient::ChannelState::LrsCallState::Reporter::OnReportDoneLocked(
|
|
1665
1491
|
grpc_byte_buffer_destroy(parent_->send_message_payload_);
|
1666
1492
|
parent_->send_message_payload_ = nullptr;
|
1667
1493
|
// If there are no more registered stats to report, cancel the call.
|
1668
|
-
|
1669
|
-
|
1494
|
+
auto it =
|
1495
|
+
xds_client()->xds_load_report_server_map_.find(parent_->chand()->server_);
|
1496
|
+
if (it == xds_client()->xds_load_report_server_map_.end() ||
|
1497
|
+
it->second.load_report_map.empty()) {
|
1498
|
+
it->second.channel_state->StopLrsCallLocked();
|
1670
1499
|
GRPC_ERROR_UNREF(error);
|
1671
1500
|
return true;
|
1672
1501
|
}
|
1673
|
-
if (error
|
1502
|
+
if (!GRPC_ERROR_IS_NONE(error) || !IsCurrentReporterOnCall()) {
|
1674
1503
|
GRPC_ERROR_UNREF(error);
|
1675
1504
|
// If this reporter is no longer the current one on the call, the reason
|
1676
1505
|
// might be that it was orphaned for a new one due to config update.
|
@@ -1698,14 +1527,15 @@ XdsClient::ChannelState::LrsCallState::LrsCallState(
|
|
1698
1527
|
// activity in xds_client()->interested_parties_, which is comprised of
|
1699
1528
|
// the polling entities from client_channel.
|
1700
1529
|
GPR_ASSERT(xds_client() != nullptr);
|
1701
|
-
const
|
1530
|
+
const char* method =
|
1702
1531
|
chand()->server_.ShouldUseV3()
|
1703
|
-
?
|
1704
|
-
:
|
1532
|
+
? "/envoy.service.load_stats.v3.LoadReportingService/StreamLoadStats"
|
1533
|
+
: "/envoy.service.load_stats.v2.LoadReportingService/StreamLoadStats";
|
1705
1534
|
call_ = grpc_channel_create_pollset_set_call(
|
1706
1535
|
chand()->channel_, nullptr, GRPC_PROPAGATE_DEFAULTS,
|
1707
|
-
xds_client()->interested_parties_,
|
1708
|
-
|
1536
|
+
xds_client()->interested_parties_,
|
1537
|
+
Slice::FromStaticString(method).c_slice(), nullptr,
|
1538
|
+
Timestamp::InfFuture(), nullptr);
|
1709
1539
|
GPR_ASSERT(call_ != nullptr);
|
1710
1540
|
// Init the request payload.
|
1711
1541
|
grpc_slice request_payload_slice =
|
@@ -1718,10 +1548,10 @@ XdsClient::ChannelState::LrsCallState::LrsCallState(
|
|
1718
1548
|
grpc_metadata_array_init(&trailing_metadata_recv_);
|
1719
1549
|
// Start the call.
|
1720
1550
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1721
|
-
gpr_log(
|
1722
|
-
|
1723
|
-
|
1724
|
-
|
1551
|
+
gpr_log(
|
1552
|
+
GPR_INFO,
|
1553
|
+
"[xds_client %p] xds server %s: starting LRS call (calld=%p, call=%p)",
|
1554
|
+
xds_client(), chand()->server_.server_uri.c_str(), this, call_);
|
1725
1555
|
}
|
1726
1556
|
// Create the ops.
|
1727
1557
|
grpc_call_error call_error;
|
@@ -1875,14 +1705,15 @@ bool XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
|
|
1875
1705
|
// Parse the response.
|
1876
1706
|
bool send_all_clusters = false;
|
1877
1707
|
std::set<std::string> new_cluster_names;
|
1878
|
-
|
1708
|
+
Duration new_load_reporting_interval;
|
1879
1709
|
grpc_error_handle parse_error = xds_client()->api_.ParseLrsResponse(
|
1880
1710
|
response_slice, &send_all_clusters, &new_cluster_names,
|
1881
1711
|
&new_load_reporting_interval);
|
1882
|
-
if (parse_error
|
1712
|
+
if (!GRPC_ERROR_IS_NONE(parse_error)) {
|
1883
1713
|
gpr_log(GPR_ERROR,
|
1884
|
-
"[xds_client %p] LRS response parsing failed
|
1885
|
-
xds_client(),
|
1714
|
+
"[xds_client %p] xds server %s: LRS response parsing failed: %s",
|
1715
|
+
xds_client(), chand()->server_.server_uri.c_str(),
|
1716
|
+
grpc_error_std_string(parse_error).c_str());
|
1886
1717
|
GRPC_ERROR_UNREF(parse_error);
|
1887
1718
|
return;
|
1888
1719
|
}
|
@@ -1890,11 +1721,12 @@ bool XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
|
|
1890
1721
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1891
1722
|
gpr_log(
|
1892
1723
|
GPR_INFO,
|
1893
|
-
"[xds_client %p] LRS response received, %" PRIuPTR
|
1724
|
+
"[xds_client %p] xds server %s: LRS response received, %" PRIuPTR
|
1894
1725
|
" cluster names, send_all_clusters=%d, load_report_interval=%" PRId64
|
1895
1726
|
"ms",
|
1896
|
-
xds_client(),
|
1897
|
-
|
1727
|
+
xds_client(), chand()->server_.server_uri.c_str(),
|
1728
|
+
new_cluster_names.size(), send_all_clusters,
|
1729
|
+
new_load_reporting_interval.millis());
|
1898
1730
|
size_t i = 0;
|
1899
1731
|
for (const auto& name : new_cluster_names) {
|
1900
1732
|
gpr_log(GPR_INFO, "[xds_client %p] cluster_name %" PRIuPTR ": %s",
|
@@ -1902,14 +1734,16 @@ bool XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
|
|
1902
1734
|
}
|
1903
1735
|
}
|
1904
1736
|
if (new_load_reporting_interval <
|
1905
|
-
|
1906
|
-
|
1907
|
-
|
1737
|
+
Duration::Milliseconds(
|
1738
|
+
GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS)) {
|
1739
|
+
new_load_reporting_interval = Duration::Milliseconds(
|
1740
|
+
GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS);
|
1908
1741
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1909
1742
|
gpr_log(GPR_INFO,
|
1910
|
-
"[xds_client %p]
|
1911
|
-
"value %dms",
|
1912
|
-
xds_client(),
|
1743
|
+
"[xds_client %p] xds server %s: increased load_report_interval "
|
1744
|
+
"to minimum value %dms",
|
1745
|
+
xds_client(), chand()->server_.server_uri.c_str(),
|
1746
|
+
GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS);
|
1913
1747
|
}
|
1914
1748
|
}
|
1915
1749
|
// Ignore identical update.
|
@@ -1917,10 +1751,11 @@ bool XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
|
|
1917
1751
|
cluster_names_ == new_cluster_names &&
|
1918
1752
|
load_reporting_interval_ == new_load_reporting_interval) {
|
1919
1753
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1920
|
-
gpr_log(
|
1921
|
-
|
1922
|
-
|
1923
|
-
|
1754
|
+
gpr_log(
|
1755
|
+
GPR_INFO,
|
1756
|
+
"[xds_client %p] xds server %s: incoming LRS response identical "
|
1757
|
+
"to current, ignoring.",
|
1758
|
+
xds_client(), chand()->server_.server_uri.c_str());
|
1924
1759
|
}
|
1925
1760
|
return;
|
1926
1761
|
}
|
@@ -1966,15 +1801,16 @@ void XdsClient::ChannelState::LrsCallState::OnStatusReceivedLocked(
|
|
1966
1801
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1967
1802
|
char* status_details = grpc_slice_to_c_string(status_details_);
|
1968
1803
|
gpr_log(GPR_INFO,
|
1969
|
-
"[xds_client %p] LRS call status received
|
1970
|
-
"
|
1971
|
-
|
1804
|
+
"[xds_client %p] xds server %s: LRS call status received "
|
1805
|
+
"(chand=%p, calld=%p, call=%p): "
|
1806
|
+
"status=%d, details='%s', error='%s'",
|
1807
|
+
xds_client(), chand()->server_.server_uri.c_str(), chand(), this,
|
1808
|
+
call_, status_code_, status_details,
|
1972
1809
|
grpc_error_std_string(error).c_str());
|
1973
1810
|
gpr_free(status_details);
|
1974
1811
|
}
|
1975
1812
|
// Ignore status from a stale call.
|
1976
1813
|
if (IsCurrentCallOnChannel()) {
|
1977
|
-
GPR_ASSERT(!xds_client()->shutting_down_);
|
1978
1814
|
// Try to restart the call.
|
1979
1815
|
parent_->OnCallFinishedLocked();
|
1980
1816
|
}
|
@@ -1994,10 +1830,10 @@ bool XdsClient::ChannelState::LrsCallState::IsCurrentCallOnChannel() const {
|
|
1994
1830
|
|
1995
1831
|
namespace {
|
1996
1832
|
|
1997
|
-
|
1998
|
-
return grpc_channel_args_find_integer(
|
1833
|
+
Duration GetRequestTimeout(const grpc_channel_args* args) {
|
1834
|
+
return Duration::Milliseconds(grpc_channel_args_find_integer(
|
1999
1835
|
args, GRPC_ARG_XDS_RESOURCE_DOES_NOT_EXIST_TIMEOUT_MS,
|
2000
|
-
{15000, 0, INT_MAX});
|
1836
|
+
{15000, 0, INT_MAX}));
|
2001
1837
|
}
|
2002
1838
|
|
2003
1839
|
grpc_channel_args* ModifyChannelArgs(const grpc_channel_args* args) {
|
@@ -2020,11 +1856,12 @@ XdsClient::XdsClient(std::unique_ptr<XdsBootstrap> bootstrap,
|
|
2020
1856
|
bootstrap_(std::move(bootstrap)),
|
2021
1857
|
args_(ModifyChannelArgs(args)),
|
2022
1858
|
request_timeout_(GetRequestTimeout(args)),
|
1859
|
+
xds_federation_enabled_(XdsFederationEnabled()),
|
2023
1860
|
interested_parties_(grpc_pollset_set_create()),
|
2024
1861
|
certificate_provider_store_(MakeOrphanable<CertificateProviderStore>(
|
2025
1862
|
bootstrap_->certificate_providers())),
|
2026
1863
|
api_(this, &grpc_xds_client_trace, bootstrap_->node(),
|
2027
|
-
&bootstrap_->certificate_providers()) {
|
1864
|
+
&bootstrap_->certificate_providers(), &symtab_) {
|
2028
1865
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2029
1866
|
gpr_log(GPR_INFO, "[xds_client %p] creating xds client", this);
|
2030
1867
|
}
|
@@ -2055,24 +1892,9 @@ void XdsClient::Orphan() {
|
|
2055
1892
|
{
|
2056
1893
|
MutexLock lock(&mu_);
|
2057
1894
|
shutting_down_ = true;
|
2058
|
-
//
|
2059
|
-
|
2060
|
-
|
2061
|
-
// is possible for ADS calls to be in progress. Unreffing the loadbalancing
|
2062
|
-
// policies before those calls are done would lead to issues such as
|
2063
|
-
// https://github.com/grpc/grpc/issues/20928.
|
2064
|
-
for (auto& a : authority_state_map_) {
|
2065
|
-
a.second.channel_state.reset();
|
2066
|
-
if (!a.second.listener_map.empty()) {
|
2067
|
-
a.second.cluster_map.clear();
|
2068
|
-
a.second.endpoint_map.clear();
|
2069
|
-
}
|
2070
|
-
}
|
2071
|
-
// We clear these invalid resource watchers as cancel never came.
|
2072
|
-
invalid_listener_watchers_.clear();
|
2073
|
-
invalid_route_config_watchers_.clear();
|
2074
|
-
invalid_cluster_watchers_.clear();
|
2075
|
-
invalid_endpoint_watchers_.clear();
|
1895
|
+
// Clear cache and any remaining watchers that may not have been cancelled.
|
1896
|
+
authority_state_map_.clear();
|
1897
|
+
invalid_watchers_.clear();
|
2076
1898
|
}
|
2077
1899
|
}
|
2078
1900
|
|
@@ -2089,204 +1911,68 @@ RefCountedPtr<XdsClient::ChannelState> XdsClient::GetOrCreateChannelStateLocked(
|
|
2089
1911
|
return channel_state;
|
2090
1912
|
}
|
2091
1913
|
|
2092
|
-
void XdsClient::
|
2093
|
-
|
2094
|
-
|
2095
|
-
|
2096
|
-
|
2097
|
-
auto
|
2098
|
-
if (!resource.ok()) {
|
2099
|
-
{
|
2100
|
-
MutexLock lock(&mu_);
|
2101
|
-
invalid_listener_watchers_[w] = watcher;
|
2102
|
-
}
|
2103
|
-
grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
|
2104
|
-
"Unable to parse resource name for listener %s", listener_name));
|
2105
|
-
work_serializer_.Run(
|
2106
|
-
// TODO(yashykt): When we move to C++14, capture watcher using
|
2107
|
-
// std::move()
|
2108
|
-
[watcher, error]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) {
|
2109
|
-
watcher->OnError(error);
|
2110
|
-
},
|
2111
|
-
DEBUG_LOCATION);
|
2112
|
-
return;
|
2113
|
-
}
|
2114
|
-
{
|
2115
|
-
MutexLock lock(&mu_);
|
2116
|
-
AuthorityState& authority_state = authority_state_map_[resource->authority];
|
2117
|
-
ListenerState& listener_state = authority_state.listener_map[resource->id];
|
2118
|
-
listener_state.watchers[w] = watcher;
|
2119
|
-
// If we've already received an LDS update, notify the new watcher
|
2120
|
-
// immediately.
|
2121
|
-
if (listener_state.update.has_value()) {
|
2122
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2123
|
-
gpr_log(GPR_INFO,
|
2124
|
-
"[xds_client %p] returning cached listener data for %s", this,
|
2125
|
-
listener_name_str.c_str());
|
2126
|
-
}
|
2127
|
-
auto& value = listener_state.update.value();
|
2128
|
-
work_serializer_.Schedule(
|
2129
|
-
// TODO(yashykt): When we move to C++14, capture watcher using
|
2130
|
-
// std::move()
|
2131
|
-
[watcher, value]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_) {
|
2132
|
-
watcher->OnListenerChanged(value);
|
2133
|
-
},
|
2134
|
-
DEBUG_LOCATION);
|
2135
|
-
}
|
2136
|
-
// If the authority doesn't yet have a channel, set it, creating it if
|
2137
|
-
// needed.
|
2138
|
-
if (authority_state.channel_state == nullptr) {
|
2139
|
-
authority_state.channel_state =
|
2140
|
-
GetOrCreateChannelStateLocked(bootstrap_->server());
|
2141
|
-
}
|
2142
|
-
authority_state.channel_state->SubscribeLocked(XdsApi::kLdsTypeUrl,
|
2143
|
-
*resource);
|
2144
|
-
}
|
2145
|
-
work_serializer_.DrainQueue();
|
2146
|
-
}
|
2147
|
-
|
2148
|
-
void XdsClient::CancelListenerDataWatch(absl::string_view listener_name,
|
2149
|
-
ListenerWatcherInterface* watcher,
|
2150
|
-
bool delay_unsubscription) {
|
2151
|
-
MutexLock lock(&mu_);
|
2152
|
-
if (shutting_down_) return;
|
2153
|
-
auto resource = XdsApi::ParseResourceName(listener_name, XdsApi::IsLds);
|
2154
|
-
if (!resource.ok()) return;
|
2155
|
-
auto& authority_state = authority_state_map_[resource->authority];
|
2156
|
-
ListenerState& listener_state = authority_state.listener_map[resource->id];
|
2157
|
-
auto it = listener_state.watchers.find(watcher);
|
2158
|
-
if (it == listener_state.watchers.end()) {
|
2159
|
-
invalid_listener_watchers_.erase(watcher);
|
2160
|
-
return;
|
2161
|
-
}
|
2162
|
-
listener_state.watchers.erase(it);
|
2163
|
-
if (!listener_state.watchers.empty()) return;
|
2164
|
-
authority_state.listener_map.erase(resource->id);
|
2165
|
-
xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
|
2166
|
-
XdsApi::kLdsTypeUrl, *resource, delay_unsubscription);
|
2167
|
-
if (!authority_state.HasSubscribedResources()) {
|
2168
|
-
authority_state.channel_state.reset();
|
2169
|
-
}
|
2170
|
-
}
|
2171
|
-
|
2172
|
-
void XdsClient::WatchRouteConfigData(
|
2173
|
-
absl::string_view route_config_name,
|
2174
|
-
RefCountedPtr<RouteConfigWatcherInterface> watcher) {
|
2175
|
-
std::string route_config_name_str = std::string(route_config_name);
|
2176
|
-
RouteConfigWatcherInterface* w = watcher.get();
|
2177
|
-
auto resource = XdsApi::ParseResourceName(route_config_name, XdsApi::IsRds);
|
2178
|
-
if (!resource.ok()) {
|
1914
|
+
void XdsClient::WatchResource(const XdsResourceType* type,
|
1915
|
+
absl::string_view name,
|
1916
|
+
RefCountedPtr<ResourceWatcherInterface> watcher) {
|
1917
|
+
ResourceWatcherInterface* w = watcher.get();
|
1918
|
+
// Lambda for handling failure cases.
|
1919
|
+
auto fail = [&](absl::Status status) mutable {
|
2179
1920
|
{
|
2180
1921
|
MutexLock lock(&mu_);
|
2181
|
-
|
1922
|
+
MaybeRegisterResourceTypeLocked(type);
|
1923
|
+
invalid_watchers_[w] = watcher;
|
2182
1924
|
}
|
2183
|
-
grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
|
2184
|
-
absl::StrFormat("Unable to parse resource name for route config %s",
|
2185
|
-
route_config_name));
|
2186
1925
|
work_serializer_.Run(
|
2187
1926
|
// TODO(yashykt): When we move to C++14, capture watcher using
|
2188
1927
|
// std::move()
|
2189
|
-
[watcher,
|
2190
|
-
watcher->OnError(
|
1928
|
+
[watcher, status]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) {
|
1929
|
+
watcher->OnError(status);
|
2191
1930
|
},
|
2192
1931
|
DEBUG_LOCATION);
|
1932
|
+
};
|
1933
|
+
auto resource_name = ParseXdsResourceName(name, type);
|
1934
|
+
if (!resource_name.ok()) {
|
1935
|
+
fail(absl::UnavailableError(absl::StrFormat(
|
1936
|
+
"Unable to parse resource name for listener %s", name)));
|
2193
1937
|
return;
|
2194
1938
|
}
|
2195
|
-
|
2196
|
-
|
2197
|
-
|
2198
|
-
|
2199
|
-
|
2200
|
-
|
2201
|
-
|
2202
|
-
|
2203
|
-
|
2204
|
-
|
2205
|
-
gpr_log(GPR_INFO,
|
2206
|
-
"[xds_client %p] returning cached route config data for %s",
|
2207
|
-
this, route_config_name_str.c_str());
|
2208
|
-
}
|
2209
|
-
auto& value = route_config_state.update.value();
|
2210
|
-
work_serializer_.Schedule(
|
2211
|
-
[watcher, value]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_) {
|
2212
|
-
watcher->OnRouteConfigChanged(value);
|
2213
|
-
},
|
2214
|
-
DEBUG_LOCATION);
|
1939
|
+
// Find server to use.
|
1940
|
+
const XdsBootstrap::XdsServer* xds_server = nullptr;
|
1941
|
+
absl::string_view authority_name = resource_name->authority;
|
1942
|
+
if (absl::ConsumePrefix(&authority_name, "xdstp:")) {
|
1943
|
+
auto* authority = bootstrap_->LookupAuthority(std::string(authority_name));
|
1944
|
+
if (authority == nullptr) {
|
1945
|
+
fail(absl::UnavailableError(
|
1946
|
+
absl::StrCat("authority \"", authority_name,
|
1947
|
+
"\" not present in bootstrap config")));
|
1948
|
+
return;
|
2215
1949
|
}
|
2216
|
-
|
2217
|
-
|
2218
|
-
if (authority_state.channel_state == nullptr) {
|
2219
|
-
authority_state.channel_state =
|
2220
|
-
GetOrCreateChannelStateLocked(bootstrap_->server());
|
1950
|
+
if (!authority->xds_servers.empty()) {
|
1951
|
+
xds_server = &authority->xds_servers[0];
|
2221
1952
|
}
|
2222
|
-
authority_state.channel_state->SubscribeLocked(XdsApi::kRdsTypeUrl,
|
2223
|
-
*resource);
|
2224
|
-
}
|
2225
|
-
work_serializer_.DrainQueue();
|
2226
|
-
}
|
2227
|
-
|
2228
|
-
void XdsClient::CancelRouteConfigDataWatch(absl::string_view route_config_name,
|
2229
|
-
RouteConfigWatcherInterface* watcher,
|
2230
|
-
bool delay_unsubscription) {
|
2231
|
-
MutexLock lock(&mu_);
|
2232
|
-
if (shutting_down_) return;
|
2233
|
-
auto resource = XdsApi::ParseResourceName(route_config_name, XdsApi::IsRds);
|
2234
|
-
if (!resource.ok()) return;
|
2235
|
-
auto& authority_state = authority_state_map_[resource->authority];
|
2236
|
-
RouteConfigState& route_config_state =
|
2237
|
-
authority_state.route_config_map[resource->id];
|
2238
|
-
auto it = route_config_state.watchers.find(watcher);
|
2239
|
-
if (it == route_config_state.watchers.end()) {
|
2240
|
-
invalid_route_config_watchers_.erase(watcher);
|
2241
|
-
return;
|
2242
|
-
}
|
2243
|
-
route_config_state.watchers.erase(it);
|
2244
|
-
if (!route_config_state.watchers.empty()) return;
|
2245
|
-
authority_state.route_config_map.erase(resource->id);
|
2246
|
-
xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
|
2247
|
-
XdsApi::kRdsTypeUrl, *resource, delay_unsubscription);
|
2248
|
-
if (!authority_state.HasSubscribedResources()) {
|
2249
|
-
authority_state.channel_state.reset();
|
2250
|
-
}
|
2251
|
-
}
|
2252
|
-
|
2253
|
-
void XdsClient::WatchClusterData(
|
2254
|
-
absl::string_view cluster_name,
|
2255
|
-
RefCountedPtr<ClusterWatcherInterface> watcher) {
|
2256
|
-
std::string cluster_name_str = std::string(cluster_name);
|
2257
|
-
ClusterWatcherInterface* w = watcher.get();
|
2258
|
-
auto resource = XdsApi::ParseResourceName(cluster_name, XdsApi::IsCds);
|
2259
|
-
if (!resource.ok()) {
|
2260
|
-
{
|
2261
|
-
MutexLock lock(&mu_);
|
2262
|
-
invalid_cluster_watchers_[w] = watcher;
|
2263
|
-
}
|
2264
|
-
grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
|
2265
|
-
"Unable to parse resource name for cluster %s", cluster_name));
|
2266
|
-
work_serializer_.Run([watcher, error]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(
|
2267
|
-
work_serializer_) { watcher->OnError(error); },
|
2268
|
-
DEBUG_LOCATION);
|
2269
|
-
return;
|
2270
1953
|
}
|
1954
|
+
if (xds_server == nullptr) xds_server = &bootstrap_->server();
|
2271
1955
|
{
|
2272
1956
|
MutexLock lock(&mu_);
|
2273
|
-
|
2274
|
-
|
2275
|
-
|
2276
|
-
|
2277
|
-
|
2278
|
-
|
1957
|
+
MaybeRegisterResourceTypeLocked(type);
|
1958
|
+
AuthorityState& authority_state =
|
1959
|
+
authority_state_map_[resource_name->authority];
|
1960
|
+
ResourceState& resource_state =
|
1961
|
+
authority_state.resource_map[type][resource_name->key];
|
1962
|
+
resource_state.watchers[w] = watcher;
|
1963
|
+
// If we already have a cached value for the resource, notify the new
|
1964
|
+
// watcher immediately.
|
1965
|
+
if (resource_state.resource != nullptr) {
|
2279
1966
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2280
1967
|
gpr_log(GPR_INFO,
|
2281
|
-
"[xds_client %p] returning cached
|
2282
|
-
|
1968
|
+
"[xds_client %p] returning cached listener data for %s", this,
|
1969
|
+
std::string(name).c_str());
|
2283
1970
|
}
|
2284
|
-
auto
|
1971
|
+
auto* value = type->CopyResource(resource_state.resource.get()).release();
|
2285
1972
|
work_serializer_.Schedule(
|
2286
|
-
|
2287
|
-
|
2288
|
-
|
2289
|
-
watcher->OnClusterChanged(value);
|
1973
|
+
[watcher, value]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) {
|
1974
|
+
watcher->OnGenericResourceChanged(value);
|
1975
|
+
delete value;
|
2290
1976
|
},
|
2291
1977
|
DEBUG_LOCATION);
|
2292
1978
|
}
|
@@ -2294,128 +1980,142 @@ void XdsClient::WatchClusterData(
|
|
2294
1980
|
// needed.
|
2295
1981
|
if (authority_state.channel_state == nullptr) {
|
2296
1982
|
authority_state.channel_state =
|
2297
|
-
GetOrCreateChannelStateLocked(
|
1983
|
+
GetOrCreateChannelStateLocked(*xds_server);
|
2298
1984
|
}
|
2299
|
-
authority_state.channel_state->SubscribeLocked(
|
2300
|
-
*resource);
|
1985
|
+
authority_state.channel_state->SubscribeLocked(type, *resource_name);
|
2301
1986
|
}
|
2302
1987
|
work_serializer_.DrainQueue();
|
2303
1988
|
}
|
2304
1989
|
|
2305
|
-
void XdsClient::
|
2306
|
-
|
2307
|
-
|
1990
|
+
void XdsClient::CancelResourceWatch(const XdsResourceType* type,
|
1991
|
+
absl::string_view name,
|
1992
|
+
ResourceWatcherInterface* watcher,
|
1993
|
+
bool delay_unsubscription) {
|
1994
|
+
auto resource_name = ParseXdsResourceName(name, type);
|
2308
1995
|
MutexLock lock(&mu_);
|
2309
|
-
|
2310
|
-
|
2311
|
-
|
2312
|
-
|
2313
|
-
|
2314
|
-
auto
|
2315
|
-
if (
|
2316
|
-
|
2317
|
-
|
2318
|
-
|
2319
|
-
|
2320
|
-
|
2321
|
-
|
2322
|
-
|
2323
|
-
|
2324
|
-
|
2325
|
-
|
2326
|
-
|
2327
|
-
|
2328
|
-
|
2329
|
-
|
2330
|
-
|
2331
|
-
|
2332
|
-
|
2333
|
-
|
2334
|
-
|
2335
|
-
|
2336
|
-
|
2337
|
-
|
2338
|
-
|
2339
|
-
|
2340
|
-
|
2341
|
-
|
2342
|
-
|
2343
|
-
work_serializer_.Run([watcher, error]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(
|
2344
|
-
work_serializer_) { watcher->OnError(error); },
|
2345
|
-
DEBUG_LOCATION);
|
2346
|
-
return;
|
2347
|
-
}
|
2348
|
-
{
|
2349
|
-
MutexLock lock(&mu_);
|
2350
|
-
auto& authority_state = authority_state_map_[resource->authority];
|
2351
|
-
EndpointState& endpoint_state = authority_state.endpoint_map[resource->id];
|
2352
|
-
endpoint_state.watchers[w] = watcher;
|
2353
|
-
// If we've already received an EDS update, notify the new watcher
|
2354
|
-
// immediately.
|
2355
|
-
if (endpoint_state.update.has_value()) {
|
2356
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2357
|
-
gpr_log(GPR_INFO,
|
2358
|
-
"[xds_client %p] returning cached endpoint data for %s", this,
|
2359
|
-
eds_service_name_str.c_str());
|
1996
|
+
// We cannot be sure whether the watcher is in invalid_watchers_ or in
|
1997
|
+
// authority_state_map_, so we check both, just to be safe.
|
1998
|
+
invalid_watchers_.erase(watcher);
|
1999
|
+
// Find authority.
|
2000
|
+
if (!resource_name.ok()) return;
|
2001
|
+
auto authority_it = authority_state_map_.find(resource_name->authority);
|
2002
|
+
if (authority_it == authority_state_map_.end()) return;
|
2003
|
+
AuthorityState& authority_state = authority_it->second;
|
2004
|
+
// Find type map.
|
2005
|
+
auto type_it = authority_state.resource_map.find(type);
|
2006
|
+
if (type_it == authority_state.resource_map.end()) return;
|
2007
|
+
auto& type_map = type_it->second;
|
2008
|
+
// Find resource key.
|
2009
|
+
auto resource_it = type_map.find(resource_name->key);
|
2010
|
+
if (resource_it == type_map.end()) return;
|
2011
|
+
ResourceState& resource_state = resource_it->second;
|
2012
|
+
// Remove watcher.
|
2013
|
+
resource_state.watchers.erase(watcher);
|
2014
|
+
// Clean up empty map entries, if any.
|
2015
|
+
if (resource_state.watchers.empty()) {
|
2016
|
+
if (resource_state.ignored_deletion) {
|
2017
|
+
gpr_log(GPR_INFO,
|
2018
|
+
"[xds_client %p] unsubscribing from a resource for which we "
|
2019
|
+
"previously ignored a deletion: type %s name %s",
|
2020
|
+
this, std::string(type->type_url()).c_str(),
|
2021
|
+
std::string(name).c_str());
|
2022
|
+
}
|
2023
|
+
authority_state.channel_state->UnsubscribeLocked(type, *resource_name,
|
2024
|
+
delay_unsubscription);
|
2025
|
+
type_map.erase(resource_it);
|
2026
|
+
if (type_map.empty()) {
|
2027
|
+
authority_state.resource_map.erase(type_it);
|
2028
|
+
if (authority_state.resource_map.empty()) {
|
2029
|
+
authority_state.channel_state.reset();
|
2360
2030
|
}
|
2361
|
-
auto& value = endpoint_state.update.value();
|
2362
|
-
work_serializer_.Schedule(
|
2363
|
-
[watcher, value]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_) {
|
2364
|
-
watcher->OnEndpointChanged(value);
|
2365
|
-
},
|
2366
|
-
DEBUG_LOCATION);
|
2367
2031
|
}
|
2368
|
-
// If the authority doesn't yet have a channel, set it, creating it if
|
2369
|
-
// needed.
|
2370
|
-
if (authority_state.channel_state == nullptr) {
|
2371
|
-
authority_state.channel_state =
|
2372
|
-
GetOrCreateChannelStateLocked(bootstrap_->server());
|
2373
|
-
}
|
2374
|
-
authority_state.channel_state->SubscribeLocked(XdsApi::kEdsTypeUrl,
|
2375
|
-
*resource);
|
2376
2032
|
}
|
2377
|
-
work_serializer_.DrainQueue();
|
2378
2033
|
}
|
2379
2034
|
|
2380
|
-
void XdsClient::
|
2381
|
-
|
2382
|
-
|
2383
|
-
|
2384
|
-
|
2385
|
-
auto resource = XdsApi::ParseResourceName(eds_service_name, XdsApi::IsEds);
|
2386
|
-
if (!resource.ok()) return;
|
2387
|
-
auto& authority_state = authority_state_map_[resource->authority];
|
2388
|
-
EndpointState& endpoint_state = authority_state.endpoint_map[resource->id];
|
2389
|
-
auto it = endpoint_state.watchers.find(watcher);
|
2390
|
-
if (it == endpoint_state.watchers.end()) {
|
2391
|
-
invalid_endpoint_watchers_.erase(watcher);
|
2035
|
+
void XdsClient::MaybeRegisterResourceTypeLocked(
|
2036
|
+
const XdsResourceType* resource_type) {
|
2037
|
+
auto it = resource_types_.find(resource_type->type_url());
|
2038
|
+
if (it != resource_types_.end()) {
|
2039
|
+
GPR_ASSERT(it->second == resource_type);
|
2392
2040
|
return;
|
2393
2041
|
}
|
2394
|
-
|
2395
|
-
|
2396
|
-
|
2397
|
-
|
2398
|
-
|
2399
|
-
|
2400
|
-
|
2401
|
-
|
2042
|
+
resource_types_.emplace(resource_type->type_url(), resource_type);
|
2043
|
+
v2_resource_types_.emplace(resource_type->v2_type_url(), resource_type);
|
2044
|
+
resource_type->InitUpbSymtab(symtab_.ptr());
|
2045
|
+
}
|
2046
|
+
|
2047
|
+
const XdsResourceType* XdsClient::GetResourceTypeLocked(
|
2048
|
+
absl::string_view resource_type) {
|
2049
|
+
auto it = resource_types_.find(resource_type);
|
2050
|
+
if (it != resource_types_.end()) return it->second;
|
2051
|
+
auto it2 = v2_resource_types_.find(resource_type);
|
2052
|
+
if (it2 != v2_resource_types_.end()) return it2->second;
|
2053
|
+
return nullptr;
|
2054
|
+
}
|
2055
|
+
|
2056
|
+
absl::StatusOr<XdsClient::XdsResourceName> XdsClient::ParseXdsResourceName(
|
2057
|
+
absl::string_view name, const XdsResourceType* type) {
|
2058
|
+
// Old-style names use the empty string for authority.
|
2059
|
+
// authority is prefixed with "old:" to indicate that it's an old-style name.
|
2060
|
+
if (!xds_federation_enabled_ || !absl::StartsWith(name, "xdstp:")) {
|
2061
|
+
return XdsResourceName{"old:", {std::string(name), {}}};
|
2062
|
+
}
|
2063
|
+
// New style name. Parse URI.
|
2064
|
+
auto uri = URI::Parse(name);
|
2065
|
+
if (!uri.ok()) return uri.status();
|
2066
|
+
// Split the resource type off of the path to get the id.
|
2067
|
+
std::pair<absl::string_view, absl::string_view> path_parts = absl::StrSplit(
|
2068
|
+
absl::StripPrefix(uri->path(), "/"), absl::MaxSplits('/', 1));
|
2069
|
+
if (!type->IsType(path_parts.first, nullptr)) {
|
2070
|
+
return absl::InvalidArgumentError(
|
2071
|
+
"xdstp URI path must indicate valid xDS resource type");
|
2072
|
+
}
|
2073
|
+
// Canonicalize order of query params.
|
2074
|
+
std::vector<URI::QueryParam> query_params;
|
2075
|
+
for (const auto& p : uri->query_parameter_map()) {
|
2076
|
+
query_params.emplace_back(
|
2077
|
+
URI::QueryParam{std::string(p.first), std::string(p.second)});
|
2078
|
+
}
|
2079
|
+
return XdsResourceName{
|
2080
|
+
absl::StrCat("xdstp:", uri->authority()),
|
2081
|
+
{std::string(path_parts.second), std::move(query_params)}};
|
2082
|
+
}
|
2083
|
+
|
2084
|
+
std::string XdsClient::ConstructFullXdsResourceName(
|
2085
|
+
absl::string_view authority, absl::string_view resource_type,
|
2086
|
+
const XdsResourceKey& key) {
|
2087
|
+
if (absl::ConsumePrefix(&authority, "xdstp:")) {
|
2088
|
+
auto uri = URI::Create("xdstp", std::string(authority),
|
2089
|
+
absl::StrCat("/", resource_type, "/", key.id),
|
2090
|
+
key.query_params, /*fragment=*/"");
|
2091
|
+
GPR_ASSERT(uri.ok());
|
2092
|
+
return uri->ToString();
|
2093
|
+
}
|
2094
|
+
// Old-style name.
|
2095
|
+
return key.id;
|
2402
2096
|
}
|
2403
2097
|
|
2404
2098
|
RefCountedPtr<XdsClusterDropStats> XdsClient::AddClusterDropStats(
|
2405
|
-
|
2099
|
+
const XdsBootstrap::XdsServer& xds_server, absl::string_view cluster_name,
|
2406
2100
|
absl::string_view eds_service_name) {
|
2407
|
-
|
2408
|
-
// server name specified in lrs_server.
|
2101
|
+
if (!bootstrap_->XdsServerExists(xds_server)) return nullptr;
|
2409
2102
|
auto key =
|
2410
2103
|
std::make_pair(std::string(cluster_name), std::string(eds_service_name));
|
2411
2104
|
MutexLock lock(&mu_);
|
2412
|
-
// We jump through some hoops here to make sure that the
|
2413
|
-
//
|
2105
|
+
// We jump through some hoops here to make sure that the const
|
2106
|
+
// XdsBootstrap::XdsServer& and absl::string_views
|
2107
|
+
// stored in the XdsClusterDropStats object point to the
|
2108
|
+
// XdsBootstrap::XdsServer and strings
|
2414
2109
|
// in the load_report_map_ key, so that they have the same lifetime.
|
2415
|
-
auto
|
2416
|
-
|
2417
|
-
|
2418
|
-
|
2110
|
+
auto server_it =
|
2111
|
+
xds_load_report_server_map_.emplace(xds_server, LoadReportServer()).first;
|
2112
|
+
if (server_it->second.channel_state == nullptr) {
|
2113
|
+
server_it->second.channel_state = GetOrCreateChannelStateLocked(xds_server);
|
2114
|
+
}
|
2115
|
+
auto load_report_it = server_it->second.load_report_map
|
2116
|
+
.emplace(std::move(key), LoadReportState())
|
2117
|
+
.first;
|
2118
|
+
LoadReportState& load_report_state = load_report_it->second;
|
2419
2119
|
RefCountedPtr<XdsClusterDropStats> cluster_drop_stats;
|
2420
2120
|
if (load_report_state.drop_stats != nullptr) {
|
2421
2121
|
cluster_drop_stats = load_report_state.drop_stats->RefIfNonZero();
|
@@ -2426,31 +2126,26 @@ RefCountedPtr<XdsClusterDropStats> XdsClient::AddClusterDropStats(
|
|
2426
2126
|
load_report_state.drop_stats->GetSnapshotAndReset();
|
2427
2127
|
}
|
2428
2128
|
cluster_drop_stats = MakeRefCounted<XdsClusterDropStats>(
|
2429
|
-
Ref(DEBUG_LOCATION, "DropStats"),
|
2430
|
-
|
2431
|
-
|
2129
|
+
Ref(DEBUG_LOCATION, "DropStats"), server_it->first,
|
2130
|
+
load_report_it->first.first /*cluster_name*/,
|
2131
|
+
load_report_it->first.second /*eds_service_name*/);
|
2432
2132
|
load_report_state.drop_stats = cluster_drop_stats.get();
|
2433
2133
|
}
|
2434
|
-
|
2435
|
-
GPR_ASSERT(resource.ok());
|
2436
|
-
auto a = authority_state_map_.find(resource->authority);
|
2437
|
-
if (a != authority_state_map_.end()) {
|
2438
|
-
a->second.channel_state->MaybeStartLrsCall();
|
2439
|
-
}
|
2134
|
+
server_it->second.channel_state->MaybeStartLrsCall();
|
2440
2135
|
return cluster_drop_stats;
|
2441
2136
|
}
|
2442
2137
|
|
2443
2138
|
void XdsClient::RemoveClusterDropStats(
|
2444
|
-
|
2139
|
+
const XdsBootstrap::XdsServer& xds_server, absl::string_view cluster_name,
|
2445
2140
|
absl::string_view eds_service_name,
|
2446
2141
|
XdsClusterDropStats* cluster_drop_stats) {
|
2447
2142
|
MutexLock lock(&mu_);
|
2448
|
-
|
2449
|
-
|
2450
|
-
auto
|
2143
|
+
auto server_it = xds_load_report_server_map_.find(xds_server);
|
2144
|
+
if (server_it == xds_load_report_server_map_.end()) return;
|
2145
|
+
auto load_report_it = server_it->second.load_report_map.find(
|
2451
2146
|
std::make_pair(std::string(cluster_name), std::string(eds_service_name)));
|
2452
|
-
if (
|
2453
|
-
LoadReportState& load_report_state =
|
2147
|
+
if (load_report_it == server_it->second.load_report_map.end()) return;
|
2148
|
+
LoadReportState& load_report_state = load_report_it->second;
|
2454
2149
|
if (load_report_state.drop_stats == cluster_drop_stats) {
|
2455
2150
|
// Record final snapshot in deleted_drop_stats, which will be
|
2456
2151
|
// added to the next load report.
|
@@ -2461,21 +2156,27 @@ void XdsClient::RemoveClusterDropStats(
|
|
2461
2156
|
}
|
2462
2157
|
|
2463
2158
|
RefCountedPtr<XdsClusterLocalityStats> XdsClient::AddClusterLocalityStats(
|
2464
|
-
|
2159
|
+
const XdsBootstrap::XdsServer& xds_server, absl::string_view cluster_name,
|
2465
2160
|
absl::string_view eds_service_name,
|
2466
2161
|
RefCountedPtr<XdsLocalityName> locality) {
|
2467
|
-
|
2468
|
-
// server name specified in lrs_server.
|
2162
|
+
if (!bootstrap_->XdsServerExists(xds_server)) return nullptr;
|
2469
2163
|
auto key =
|
2470
2164
|
std::make_pair(std::string(cluster_name), std::string(eds_service_name));
|
2471
2165
|
MutexLock lock(&mu_);
|
2472
|
-
// We jump through some hoops here to make sure that the
|
2473
|
-
//
|
2166
|
+
// We jump through some hoops here to make sure that the const
|
2167
|
+
// XdsBootstrap::XdsServer& and absl::string_views
|
2168
|
+
// stored in the XdsClusterDropStats object point to the
|
2169
|
+
// XdsBootstrap::XdsServer and strings
|
2474
2170
|
// in the load_report_map_ key, so that they have the same lifetime.
|
2475
|
-
auto
|
2476
|
-
|
2477
|
-
|
2478
|
-
|
2171
|
+
auto server_it =
|
2172
|
+
xds_load_report_server_map_.emplace(xds_server, LoadReportServer()).first;
|
2173
|
+
if (server_it->second.channel_state == nullptr) {
|
2174
|
+
server_it->second.channel_state = GetOrCreateChannelStateLocked(xds_server);
|
2175
|
+
}
|
2176
|
+
auto load_report_it = server_it->second.load_report_map
|
2177
|
+
.emplace(std::move(key), LoadReportState())
|
2178
|
+
.first;
|
2179
|
+
LoadReportState& load_report_state = load_report_it->second;
|
2479
2180
|
LoadReportState::LocalityState& locality_state =
|
2480
2181
|
load_report_state.locality_stats[locality];
|
2481
2182
|
RefCountedPtr<XdsClusterLocalityStats> cluster_locality_stats;
|
@@ -2488,32 +2189,27 @@ RefCountedPtr<XdsClusterLocalityStats> XdsClient::AddClusterLocalityStats(
|
|
2488
2189
|
locality_state.locality_stats->GetSnapshotAndReset();
|
2489
2190
|
}
|
2490
2191
|
cluster_locality_stats = MakeRefCounted<XdsClusterLocalityStats>(
|
2491
|
-
Ref(DEBUG_LOCATION, "LocalityStats"),
|
2492
|
-
|
2493
|
-
std::move(locality));
|
2192
|
+
Ref(DEBUG_LOCATION, "LocalityStats"), server_it->first,
|
2193
|
+
load_report_it->first.first /*cluster_name*/,
|
2194
|
+
load_report_it->first.second /*eds_service_name*/, std::move(locality));
|
2494
2195
|
locality_state.locality_stats = cluster_locality_stats.get();
|
2495
2196
|
}
|
2496
|
-
|
2497
|
-
GPR_ASSERT(resource.ok());
|
2498
|
-
auto a = authority_state_map_.find(resource->authority);
|
2499
|
-
if (a != authority_state_map_.end()) {
|
2500
|
-
a->second.channel_state->MaybeStartLrsCall();
|
2501
|
-
}
|
2197
|
+
server_it->second.channel_state->MaybeStartLrsCall();
|
2502
2198
|
return cluster_locality_stats;
|
2503
2199
|
}
|
2504
2200
|
|
2505
2201
|
void XdsClient::RemoveClusterLocalityStats(
|
2506
|
-
|
2202
|
+
const XdsBootstrap::XdsServer& xds_server, absl::string_view cluster_name,
|
2507
2203
|
absl::string_view eds_service_name,
|
2508
2204
|
const RefCountedPtr<XdsLocalityName>& locality,
|
2509
2205
|
XdsClusterLocalityStats* cluster_locality_stats) {
|
2510
2206
|
MutexLock lock(&mu_);
|
2511
|
-
|
2512
|
-
|
2513
|
-
auto
|
2207
|
+
auto server_it = xds_load_report_server_map_.find(xds_server);
|
2208
|
+
if (server_it == xds_load_report_server_map_.end()) return;
|
2209
|
+
auto load_report_it = server_it->second.load_report_map.find(
|
2514
2210
|
std::make_pair(std::string(cluster_name), std::string(eds_service_name)));
|
2515
|
-
if (
|
2516
|
-
LoadReportState& load_report_state =
|
2211
|
+
if (load_report_it == server_it->second.load_report_map.end()) return;
|
2212
|
+
LoadReportState& load_report_state = load_report_it->second;
|
2517
2213
|
auto locality_it = load_report_state.locality_stats.find(locality);
|
2518
2214
|
if (locality_it == load_report_state.locality_stats.end()) return;
|
2519
2215
|
LoadReportState::LocalityState& locality_state = locality_it->second;
|
@@ -2533,68 +2229,77 @@ void XdsClient::ResetBackoff() {
|
|
2533
2229
|
}
|
2534
2230
|
}
|
2535
2231
|
|
2536
|
-
void XdsClient::NotifyOnErrorLocked(
|
2537
|
-
|
2538
|
-
|
2539
|
-
|
2540
|
-
|
2541
|
-
|
2542
|
-
|
2543
|
-
|
2544
|
-
|
2545
|
-
|
2546
|
-
|
2547
|
-
|
2548
|
-
|
2549
|
-
|
2550
|
-
for (const auto& q : route_config_state.watchers) {
|
2551
|
-
route_config_watchers.insert(q.second);
|
2552
|
-
}
|
2553
|
-
}
|
2554
|
-
for (const auto& p : a.second.cluster_map) {
|
2555
|
-
const ClusterState& cluster_state = p.second;
|
2556
|
-
for (const auto& q : cluster_state.watchers) {
|
2557
|
-
cluster_watchers.insert(q.second);
|
2558
|
-
}
|
2559
|
-
}
|
2560
|
-
for (const auto& p : a.second.endpoint_map) {
|
2561
|
-
const EndpointState& endpoint_state = p.second;
|
2562
|
-
for (const auto& q : endpoint_state.watchers) {
|
2563
|
-
endpoint_watchers.insert(q.second);
|
2232
|
+
void XdsClient::NotifyOnErrorLocked(absl::Status status) {
|
2233
|
+
const auto* node = bootstrap_->node();
|
2234
|
+
if (node != nullptr) {
|
2235
|
+
status = absl::Status(
|
2236
|
+
status.code(), absl::StrCat(status.message(),
|
2237
|
+
" (node ID:", bootstrap_->node()->id, ")"));
|
2238
|
+
}
|
2239
|
+
std::set<RefCountedPtr<ResourceWatcherInterface>> watchers;
|
2240
|
+
for (const auto& a : authority_state_map_) { // authority
|
2241
|
+
for (const auto& t : a.second.resource_map) { // type
|
2242
|
+
for (const auto& r : t.second) { // resource id
|
2243
|
+
for (const auto& w : r.second.watchers) { // watchers
|
2244
|
+
watchers.insert(w.second);
|
2245
|
+
}
|
2564
2246
|
}
|
2565
2247
|
}
|
2566
2248
|
}
|
2567
2249
|
work_serializer_.Schedule(
|
2568
|
-
// TODO(yashykt): When we move to C++14, capture
|
2250
|
+
// TODO(yashykt): When we move to C++14, capture watchers using
|
2569
2251
|
// std::move()
|
2570
|
-
[
|
2571
|
-
|
2572
|
-
|
2573
|
-
|
2574
|
-
|
2575
|
-
|
2576
|
-
|
2577
|
-
|
2578
|
-
|
2579
|
-
|
2580
|
-
|
2581
|
-
|
2582
|
-
|
2583
|
-
|
2584
|
-
|
2585
|
-
|
2586
|
-
|
2252
|
+
[watchers, status]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_) {
|
2253
|
+
for (const auto& watcher : watchers) {
|
2254
|
+
watcher->OnError(status);
|
2255
|
+
}
|
2256
|
+
},
|
2257
|
+
DEBUG_LOCATION);
|
2258
|
+
}
|
2259
|
+
|
2260
|
+
void XdsClient::NotifyWatchersOnErrorLocked(
|
2261
|
+
const std::map<ResourceWatcherInterface*,
|
2262
|
+
RefCountedPtr<ResourceWatcherInterface>>& watchers,
|
2263
|
+
absl::Status status) {
|
2264
|
+
const auto* node = bootstrap_->node();
|
2265
|
+
if (node != nullptr) {
|
2266
|
+
status = absl::Status(
|
2267
|
+
status.code(), absl::StrCat(status.message(),
|
2268
|
+
" (node ID:", bootstrap_->node()->id, ")"));
|
2269
|
+
}
|
2270
|
+
work_serializer_.Schedule(
|
2271
|
+
[watchers, status]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) {
|
2272
|
+
for (const auto& p : watchers) {
|
2273
|
+
p.first->OnError(status);
|
2274
|
+
}
|
2275
|
+
},
|
2276
|
+
DEBUG_LOCATION);
|
2277
|
+
}
|
2278
|
+
|
2279
|
+
void XdsClient::NotifyWatchersOnResourceDoesNotExist(
|
2280
|
+
const std::map<ResourceWatcherInterface*,
|
2281
|
+
RefCountedPtr<ResourceWatcherInterface>>& watchers) {
|
2282
|
+
work_serializer_.Schedule(
|
2283
|
+
[watchers]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) {
|
2284
|
+
for (const auto& p : watchers) {
|
2285
|
+
p.first->OnResourceDoesNotExist();
|
2286
|
+
}
|
2287
|
+
},
|
2587
2288
|
DEBUG_LOCATION);
|
2588
2289
|
}
|
2589
2290
|
|
2590
2291
|
XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
|
2591
|
-
|
2292
|
+
const XdsBootstrap::XdsServer& xds_server, bool send_all_clusters,
|
2293
|
+
const std::set<std::string>& clusters) {
|
2592
2294
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2593
2295
|
gpr_log(GPR_INFO, "[xds_client %p] start building load report", this);
|
2594
2296
|
}
|
2595
2297
|
XdsApi::ClusterLoadReportMap snapshot_map;
|
2596
|
-
|
2597
|
-
|
2298
|
+
auto server_it = xds_load_report_server_map_.find(xds_server);
|
2299
|
+
if (server_it == xds_load_report_server_map_.end()) return snapshot_map;
|
2300
|
+
auto& load_report_map = server_it->second.load_report_map;
|
2301
|
+
for (auto load_report_it = load_report_map.begin();
|
2302
|
+
load_report_it != load_report_map.end();) {
|
2598
2303
|
// Cluster key is cluster and EDS service name.
|
2599
2304
|
const auto& cluster_key = load_report_it->first;
|
2600
2305
|
LoadReportState& load_report = load_report_it->second;
|
@@ -2649,7 +2354,7 @@ XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
|
|
2649
2354
|
}
|
2650
2355
|
}
|
2651
2356
|
// Compute load report interval.
|
2652
|
-
const
|
2357
|
+
const Timestamp now = ExecCtx::Get()->Now();
|
2653
2358
|
snapshot.load_report_interval = now - load_report.last_report_time;
|
2654
2359
|
load_report.last_report_time = now;
|
2655
2360
|
// Record snapshot.
|
@@ -2660,7 +2365,7 @@ XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
|
|
2660
2365
|
// deleted stats objects, remove the entry.
|
2661
2366
|
if (load_report.locality_stats.empty() &&
|
2662
2367
|
load_report.drop_stats == nullptr) {
|
2663
|
-
load_report_it =
|
2368
|
+
load_report_it = load_report_map.erase(load_report_it);
|
2664
2369
|
} else {
|
2665
2370
|
++load_report_it;
|
2666
2371
|
}
|
@@ -2671,35 +2376,18 @@ XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
|
|
2671
2376
|
std::string XdsClient::DumpClientConfigBinary() {
|
2672
2377
|
MutexLock lock(&mu_);
|
2673
2378
|
XdsApi::ResourceTypeMetadataMap resource_type_metadata_map;
|
2674
|
-
auto&
|
2675
|
-
auto& rds_map = resource_type_metadata_map[XdsApi::kRdsTypeUrl];
|
2676
|
-
auto& cds_map = resource_type_metadata_map[XdsApi::kCdsTypeUrl];
|
2677
|
-
auto& eds_map = resource_type_metadata_map[XdsApi::kEdsTypeUrl];
|
2678
|
-
for (auto& a : authority_state_map_) {
|
2379
|
+
for (const auto& a : authority_state_map_) { // authority
|
2679
2380
|
const std::string& authority = a.first;
|
2680
|
-
|
2681
|
-
|
2682
|
-
|
2683
|
-
|
2684
|
-
|
2685
|
-
|
2686
|
-
|
2687
|
-
|
2688
|
-
|
2689
|
-
|
2690
|
-
authority, XdsApi::kRdsTypeUrl, route_config_name)] = &p.second.meta;
|
2691
|
-
}
|
2692
|
-
// Collect resource metadata from clusters
|
2693
|
-
for (auto& p : a.second.cluster_map) {
|
2694
|
-
const std::string& cluster_name = p.first;
|
2695
|
-
cds_map[XdsApi::ConstructFullResourceName(authority, XdsApi::kCdsTypeUrl,
|
2696
|
-
cluster_name)] = &p.second.meta;
|
2697
|
-
}
|
2698
|
-
// Collect resource metadata from endpoints
|
2699
|
-
for (auto& p : a.second.endpoint_map) {
|
2700
|
-
const std::string& endpoint_name = p.first;
|
2701
|
-
eds_map[XdsApi::ConstructFullResourceName(
|
2702
|
-
authority, XdsApi::kEdsTypeUrl, endpoint_name)] = &p.second.meta;
|
2381
|
+
for (const auto& t : a.second.resource_map) { // type
|
2382
|
+
const XdsResourceType* type = t.first;
|
2383
|
+
auto& resource_metadata_map =
|
2384
|
+
resource_type_metadata_map[type->type_url()];
|
2385
|
+
for (const auto& r : t.second) { // resource id
|
2386
|
+
const XdsResourceKey& resource_key = r.first;
|
2387
|
+
const ResourceState& resource_state = r.second;
|
2388
|
+
resource_metadata_map[ConstructFullXdsResourceName(
|
2389
|
+
authority, type->type_url(), resource_key)] = &resource_state.meta;
|
2390
|
+
}
|
2703
2391
|
}
|
2704
2392
|
}
|
2705
2393
|
// Assemble config dump messages
|
@@ -2713,6 +2401,7 @@ std::string XdsClient::DumpClientConfigBinary() {
|
|
2713
2401
|
void XdsClientGlobalInit() {
|
2714
2402
|
g_mu = new Mutex;
|
2715
2403
|
XdsHttpFilterRegistry::Init();
|
2404
|
+
XdsClusterSpecifierPluginRegistry::Init();
|
2716
2405
|
}
|
2717
2406
|
|
2718
2407
|
// TODO(roth): Find a better way to clear the fallback config that does
|
@@ -2723,6 +2412,7 @@ void XdsClientGlobalShutdown() ABSL_NO_THREAD_SAFETY_ANALYSIS {
|
|
2723
2412
|
delete g_mu;
|
2724
2413
|
g_mu = nullptr;
|
2725
2414
|
XdsHttpFilterRegistry::Shutdown();
|
2415
|
+
XdsClusterSpecifierPluginRegistry::Shutdown();
|
2726
2416
|
}
|
2727
2417
|
|
2728
2418
|
namespace {
|
@@ -2741,7 +2431,7 @@ std::string GetBootstrapContents(const char* fallback_config,
|
|
2741
2431
|
grpc_slice contents;
|
2742
2432
|
*error =
|
2743
2433
|
grpc_load_file(path.get(), /*add_null_terminator=*/true, &contents);
|
2744
|
-
if (*error
|
2434
|
+
if (!GRPC_ERROR_IS_NONE(*error)) return "";
|
2745
2435
|
std::string contents_str(StringViewFromSlice(contents));
|
2746
2436
|
grpc_slice_unref_internal(contents);
|
2747
2437
|
return contents_str;
|
@@ -2782,7 +2472,7 @@ RefCountedPtr<XdsClient> XdsClient::GetOrCreate(const grpc_channel_args* args,
|
|
2782
2472
|
if (bootstrap_config != nullptr) {
|
2783
2473
|
std::unique_ptr<XdsBootstrap> bootstrap =
|
2784
2474
|
XdsBootstrap::Create(bootstrap_config, error);
|
2785
|
-
if (*error
|
2475
|
+
if (GRPC_ERROR_IS_NONE(*error)) {
|
2786
2476
|
grpc_channel_args* xds_channel_args =
|
2787
2477
|
grpc_channel_args_find_pointer<grpc_channel_args>(
|
2788
2478
|
args,
|
@@ -2801,7 +2491,7 @@ RefCountedPtr<XdsClient> XdsClient::GetOrCreate(const grpc_channel_args* args,
|
|
2801
2491
|
// Find bootstrap contents.
|
2802
2492
|
std::string bootstrap_contents =
|
2803
2493
|
GetBootstrapContents(g_fallback_bootstrap_config, error);
|
2804
|
-
if (*error
|
2494
|
+
if (!GRPC_ERROR_IS_NONE(*error)) return nullptr;
|
2805
2495
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2806
2496
|
gpr_log(GPR_INFO, "xDS bootstrap contents: %s",
|
2807
2497
|
bootstrap_contents.c_str());
|
@@ -2809,7 +2499,7 @@ RefCountedPtr<XdsClient> XdsClient::GetOrCreate(const grpc_channel_args* args,
|
|
2809
2499
|
// Parse bootstrap.
|
2810
2500
|
std::unique_ptr<XdsBootstrap> bootstrap =
|
2811
2501
|
XdsBootstrap::Create(bootstrap_contents, error);
|
2812
|
-
if (*error
|
2502
|
+
if (!GRPC_ERROR_IS_NONE(*error)) return nullptr;
|
2813
2503
|
// Instantiate XdsClient.
|
2814
2504
|
xds_client =
|
2815
2505
|
MakeRefCounted<XdsClient>(std::move(bootstrap), g_channel_args);
|
@@ -2881,12 +2571,12 @@ RefCountedPtr<XdsClient> XdsClient::GetFromChannelArgs(
|
|
2881
2571
|
} // namespace grpc_core
|
2882
2572
|
|
2883
2573
|
// The returned bytes may contain NULL(0), so we can't use c-string.
|
2884
|
-
grpc_slice grpc_dump_xds_configs() {
|
2574
|
+
grpc_slice grpc_dump_xds_configs(void) {
|
2885
2575
|
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
|
2886
2576
|
grpc_core::ExecCtx exec_ctx;
|
2887
2577
|
grpc_error_handle error = GRPC_ERROR_NONE;
|
2888
2578
|
auto xds_client = grpc_core::XdsClient::GetOrCreate(nullptr, &error);
|
2889
|
-
if (error
|
2579
|
+
if (!GRPC_ERROR_IS_NONE(error)) {
|
2890
2580
|
// If we isn't using xDS, just return an empty string.
|
2891
2581
|
GRPC_ERROR_UNREF(error);
|
2892
2582
|
return grpc_empty_slice();
|