grpc 1.56.2 → 1.57.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Makefile +29 -22
- data/include/grpc/event_engine/event_engine.h +22 -32
- data/include/grpc/impl/grpc_types.h +3 -0
- data/include/grpc/support/port_platform.h +29 -23
- data/src/core/ext/filters/client_channel/client_channel.cc +44 -8
- data/src/core/ext/filters/client_channel/dynamic_filters.h +3 -3
- data/src/core/ext/filters/client_channel/http_proxy.cc +5 -0
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc +21 -52
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +19 -7
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +25 -35
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +78 -132
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc +2 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +4 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +3 -1
- data/src/core/ext/filters/client_channel/lb_policy/health_check_client.cc +38 -15
- data/src/core/ext/filters/client_channel/lb_policy/health_check_client.h +3 -5
- data/src/core/ext/filters/client_channel/lb_policy/health_check_client_internal.h +22 -6
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric_internal.h +2 -0
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.cc +97 -71
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +2 -16
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +56 -11
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.h +25 -0
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +6 -32
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +4 -6
- data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +20 -79
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +31 -19
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/weighted_round_robin.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +7 -41
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +3 -67
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h +8 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +31 -74
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +7 -51
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +16 -87
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_override_host.cc +16 -50
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_wrr_locality.cc +12 -74
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +1 -4
- data/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.cc +69 -59
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +7 -2
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +1 -0
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +25 -13
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +366 -311
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h +17 -1
- data/src/core/ext/filters/client_channel/retry_filter.cc +39 -2498
- data/src/core/ext/filters/client_channel/retry_filter.h +91 -1
- data/src/core/ext/filters/client_channel/retry_filter_legacy_call_data.cc +2052 -0
- data/src/core/ext/filters/client_channel/retry_filter_legacy_call_data.h +442 -0
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +38 -58
- data/src/core/ext/filters/client_channel/subchannel.h +3 -3
- data/src/core/ext/filters/client_channel/subchannel_interface_internal.h +3 -0
- data/src/core/ext/filters/rbac/rbac_filter.cc +40 -111
- data/src/core/ext/filters/rbac/rbac_filter.h +12 -30
- data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +162 -86
- data/src/core/ext/filters/stateful_session/stateful_session_filter.h +0 -6
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +7 -4
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +131 -186
- data/src/core/ext/transport/chttp2/transport/decode_huff.cc +6569 -174
- data/src/core/ext/transport/chttp2/transport/decode_huff.h +2278 -441
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +2 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parse_result.h +4 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +9 -8
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +4 -4
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +3 -2
- data/src/core/ext/transport/chttp2/transport/internal.h +8 -4
- data/src/core/ext/transport/chttp2/transport/parsing.cc +15 -3
- data/src/core/ext/transport/chttp2/transport/writing.cc +2 -3
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +27 -6
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +143 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +2 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +0 -39
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +13 -8
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +35 -6
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +17 -13
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +85 -20
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +26 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +45 -3
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c +4 -3
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h +21 -0
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +30 -6
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +180 -0
- data/src/core/ext/upb-generated/envoy/data/accesslog/v3/accesslog.upb.c +558 -0
- data/src/core/ext/upb-generated/envoy/data/accesslog/v3/accesslog.upb.h +2710 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +30 -11
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +53 -24
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +30 -5
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +110 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +41 -15
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +150 -27
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.c +1 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb.c +47 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb.h +93 -0
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +88 -76
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +11 -12
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h +0 -5
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c +162 -160
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +129 -118
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +141 -135
- data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c +19 -12
- data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c +38 -30
- data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/data/accesslog/v3/accesslog.upbdefs.c +402 -0
- data/src/core/ext/upbdefs-generated/envoy/data/accesslog/v3/accesslog.upbdefs.h +111 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +80 -74
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +63 -47
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +315 -293
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +29 -29
- data/src/core/ext/xds/xds_bootstrap_grpc.cc +33 -30
- data/src/core/ext/xds/xds_bootstrap_grpc.h +5 -13
- data/src/core/ext/xds/xds_client_grpc.cc +11 -6
- data/src/core/ext/xds/xds_client_grpc.h +16 -2
- data/src/core/ext/xds/xds_client_stats.h +10 -0
- data/src/core/ext/xds/xds_cluster.cc +26 -16
- data/src/core/ext/xds/xds_endpoint.cc +4 -7
- data/src/core/ext/xds/xds_health_status.cc +0 -17
- data/src/core/ext/xds/xds_health_status.h +5 -25
- data/src/core/ext/xds/xds_lb_policy_registry.cc +39 -0
- data/src/core/ext/xds/xds_route_config.cc +4 -0
- data/src/core/ext/xds/xds_transport_grpc.cc +1 -3
- data/src/core/lib/address_utils/parse_address.cc +63 -1
- data/src/core/lib/address_utils/parse_address.h +8 -0
- data/src/core/lib/address_utils/sockaddr_utils.cc +46 -1
- data/src/core/lib/address_utils/sockaddr_utils.h +2 -2
- data/src/core/lib/channel/channel_args.cc +21 -10
- data/src/core/lib/channel/channel_args.h +3 -0
- data/src/core/lib/channel/connected_channel.cc +4 -1
- data/src/core/lib/channel/promise_based_filter.h +1 -0
- data/src/core/lib/debug/trace.cc +1 -4
- data/src/core/lib/event_engine/cf_engine/cf_engine.cc +2 -1
- data/src/core/lib/event_engine/cf_engine/cf_engine.h +1 -1
- data/src/core/lib/event_engine/event_engine.cc +0 -12
- data/src/core/lib/event_engine/forkable.cc +47 -42
- data/src/core/lib/event_engine/handle_containers.h +0 -4
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +4 -6
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +4 -6
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +25 -11
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +3 -1
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +2 -1
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +8 -12
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +37 -27
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.h +2 -0
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +4 -2
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +42 -2
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +6 -0
- data/src/core/lib/event_engine/posix_engine/timer.h +10 -37
- data/src/core/lib/event_engine/tcp_socket_utils.cc +67 -7
- data/src/core/lib/event_engine/tcp_socket_utils.h +3 -0
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +90 -37
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +32 -12
- data/src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc +12 -21
- data/src/core/lib/event_engine/thready_event_engine/thready_event_engine.h +8 -12
- data/src/core/lib/event_engine/windows/windows_endpoint.cc +55 -54
- data/src/core/lib/event_engine/windows/windows_endpoint.h +15 -12
- data/src/core/lib/event_engine/windows/windows_engine.cc +2 -1
- data/src/core/lib/event_engine/windows/windows_engine.h +8 -12
- data/src/core/lib/experiments/config.cc +60 -22
- data/src/core/lib/experiments/config.h +20 -8
- data/src/core/lib/experiments/experiments.cc +278 -0
- data/src/core/lib/experiments/experiments.h +59 -1
- data/src/core/lib/gprpp/dual_ref_counted.h +9 -9
- data/src/core/lib/gprpp/fork.cc +8 -9
- data/src/core/lib/gprpp/fork.h +6 -5
- data/src/core/lib/gprpp/if_list.h +4530 -0
- data/src/core/lib/gprpp/orphanable.h +3 -3
- data/src/core/lib/gprpp/ref_counted.h +6 -6
- data/src/core/lib/gprpp/sorted_pack.h +3 -12
- data/src/core/lib/gprpp/status_helper.h +16 -15
- data/src/core/lib/gprpp/time.h +12 -0
- data/src/core/lib/gprpp/type_list.h +32 -0
- data/src/core/lib/http/httpcli.h +6 -9
- data/src/core/lib/iomgr/error.cc +32 -2
- data/src/core/lib/iomgr/error.h +9 -10
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +5 -7
- data/src/core/lib/iomgr/ev_poll_posix.cc +6 -5
- data/src/core/lib/iomgr/exec_ctx.h +11 -0
- data/src/core/lib/iomgr/pollset.h +4 -5
- data/src/core/lib/iomgr/port.h +10 -0
- data/src/core/lib/iomgr/resolve_address.cc +13 -1
- data/src/core/lib/iomgr/resolve_address.h +17 -3
- data/src/core/lib/iomgr/sockaddr_posix.h +7 -0
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +29 -0
- data/src/core/lib/iomgr/socket_utils_posix.cc +2 -0
- data/src/core/lib/iomgr/socket_utils_posix.h +6 -0
- data/src/core/lib/iomgr/tcp_client_posix.cc +4 -1
- data/src/core/lib/iomgr/tcp_posix.cc +21 -4
- data/src/core/lib/iomgr/tcp_server_posix.cc +3 -2
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +5 -2
- data/src/core/lib/iomgr/tcp_windows.cc +1 -3
- data/src/core/lib/iomgr/vsock.cc +59 -0
- data/src/core/lib/iomgr/vsock.h +38 -0
- data/src/core/lib/iomgr/wakeup_fd_posix.h +3 -6
- data/src/core/lib/load_balancing/delegating_helper.h +115 -0
- data/src/core/lib/load_balancing/lb_policy.h +20 -0
- data/src/core/lib/load_balancing/subchannel_interface.h +6 -0
- data/src/core/lib/promise/party.h +1 -1
- data/src/core/lib/resolver/resolver_factory.h +3 -2
- data/src/core/lib/resolver/server_address.cc +9 -94
- data/src/core/lib/resolver/server_address.h +10 -64
- data/src/core/lib/resource_quota/memory_quota.h +1 -1
- data/src/core/lib/security/credentials/channel_creds_registry.h +51 -27
- data/src/core/lib/security/credentials/channel_creds_registry_init.cc +169 -9
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +1 -1
- data/src/core/lib/security/credentials/composite/composite_credentials.h +3 -1
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +40 -1
- data/src/core/lib/security/credentials/external/external_account_credentials.h +6 -0
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +30 -38
- data/src/core/lib/security/credentials/fake/fake_credentials.h +28 -0
- data/src/core/lib/security/credentials/tls/tls_credentials.cc +1 -1
- data/src/core/lib/security/credentials/tls/tls_credentials.h +3 -1
- data/src/core/lib/service_config/service_config_call_data.h +5 -0
- data/src/core/lib/slice/slice.h +16 -0
- data/src/core/lib/surface/call.cc +31 -29
- data/src/core/lib/surface/server.h +2 -2
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/metadata_batch.cc +7 -7
- data/src/core/lib/transport/metadata_batch.h +86 -48
- data/src/core/lib/transport/parsed_metadata.h +34 -20
- data/src/core/lib/transport/simple_slice_based_metadata.h +9 -2
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc +4 -6
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +1 -2
- data/src/core/tsi/ssl_transport_security.cc +28 -7
- data/src/ruby/bin/math_pb.rb +24 -18
- data/src/ruby/ext/grpc/extconf.rb +19 -18
- data/src/ruby/ext/grpc/rb_call.c +62 -39
- data/src/ruby/ext/grpc/rb_call_credentials.c +0 -1
- data/src/ruby/ext/grpc/rb_channel.c +126 -49
- data/src/ruby/ext/grpc/rb_channel.h +1 -0
- data/src/ruby/ext/grpc/rb_channel_args.c +16 -2
- data/src/ruby/ext/grpc/rb_channel_args.h +4 -0
- data/src/ruby/ext/grpc/rb_channel_credentials.c +0 -1
- data/src/ruby/ext/grpc/rb_compression_options.c +0 -1
- data/src/ruby/ext/grpc/rb_event_thread.c +22 -6
- data/src/ruby/ext/grpc/rb_event_thread.h +1 -0
- data/src/ruby/ext/grpc/rb_grpc.c +192 -30
- data/src/ruby/ext/grpc/rb_grpc.h +8 -2
- data/src/ruby/ext/grpc/rb_server.c +62 -45
- data/src/ruby/ext/grpc/rb_server_credentials.c +0 -1
- data/src/ruby/ext/grpc/rb_xds_channel_credentials.c +0 -1
- data/src/ruby/ext/grpc/rb_xds_server_credentials.c +0 -1
- data/src/ruby/lib/grpc/generic/bidi_call.rb +2 -0
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/grpc/health/v1/health_pb.rb +24 -13
- data/src/ruby/pb/src/proto/grpc/testing/empty_pb.rb +24 -3
- data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +25 -111
- data/src/ruby/pb/src/proto/grpc/testing/test_pb.rb +25 -2
- data/third_party/boringssl-with-bazel/err_data.c +552 -552
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_strnid.c +5 -5
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c +34 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c +4 -1
- data/third_party/boringssl-with-bazel/src/crypto/bio/bio.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/bio/bio_mem.c +7 -8
- data/third_party/boringssl-with-bazel/src/crypto/bio/connect.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/bio/fd.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/bio/file.c +8 -8
- data/third_party/boringssl-with-bazel/src/crypto/bio/socket.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/bio/socket_helper.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/chacha/chacha.c +19 -1
- data/third_party/boringssl-with-bazel/src/crypto/chacha/internal.h +8 -1
- data/third_party/boringssl-with-bazel/src/crypto/conf/conf.c +28 -185
- data/third_party/boringssl-with-bazel/src/crypto/conf/conf_def.h +3 -7
- data/third_party/boringssl-with-bazel/src/crypto/conf/internal.h +8 -0
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_apple.c +3 -0
- data/third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519.c +49 -46
- data/third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519_64_adx.c +18 -0
- data/third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519_tables.h +2809 -7417
- data/third_party/boringssl-with-bazel/src/crypto/curve25519/internal.h +27 -5
- data/third_party/boringssl-with-bazel/src/crypto/dsa/internal.h +20 -0
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_asn1.c +110 -72
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_derive.c +4 -3
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/hash_to_curve.c +15 -14
- data/third_party/boringssl-with-bazel/src/crypto/err/err.c +13 -10
- data/third_party/boringssl-with-bazel/src/crypto/evp/evp.c +35 -12
- data/third_party/boringssl-with-bazel/src/crypto/evp/p_ec.c +2 -4
- data/third_party/boringssl-with-bazel/src/crypto/evp/p_ec_asn1.c +3 -7
- data/third_party/boringssl-with-bazel/src/crypto/evp/pbkdf.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/evp/print.c +7 -6
- data/third_party/boringssl-with-bazel/src/crypto/ex_data.c +34 -72
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/div.c +12 -5
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/gcd.c +5 -6
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/internal.h +12 -6
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/montgomery.c +17 -18
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/montgomery_inv.c +51 -15
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/rsaz_exp.c +7 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/delocate.h +5 -6
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/internal.h +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/builtin_curves.h +277 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec.c +180 -404
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec_key.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec_montgomery.c +24 -57
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/felem.c +17 -13
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h +33 -71
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/oct.c +18 -17
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p224-64.c +5 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256-nistz.c +15 -18
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256.c +9 -11
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/scalar.c +24 -24
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/simple.c +11 -27
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/simple_mul.c +8 -8
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/wnaf.c +4 -4
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/ecdsa.c +9 -3
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/hkdf/hkdf.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/fork_detect.c +40 -26
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/internal.h +21 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/rand.c +38 -19
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/urandom.c +2 -29
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/internal.h +55 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa_impl.c +33 -52
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +3 -8
- data/third_party/boringssl-with-bazel/src/crypto/internal.h +198 -79
- data/third_party/boringssl-with-bazel/src/crypto/kyber/kyber.c +5 -4
- data/third_party/boringssl-with-bazel/src/crypto/mem.c +7 -8
- data/third_party/boringssl-with-bazel/src/crypto/obj/obj.c +19 -23
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/internal.h +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/p5_pbev2.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8.c +7 -7
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c +8 -5
- data/third_party/boringssl-with-bazel/src/crypto/pool/internal.h +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/deterministic.c +7 -6
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/forkunsafe.c +6 -12
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/getentropy.c +48 -0
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/{fuchsia.c → ios.c} +8 -8
- data/third_party/boringssl-with-bazel/src/crypto/{refcount_no_threads.c → rand_extra/trusty.c} +15 -19
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/windows.c +41 -19
- data/third_party/boringssl-with-bazel/src/crypto/{refcount_c11.c → refcount.c} +11 -17
- data/third_party/boringssl-with-bazel/src/crypto/stack/stack.c +147 -72
- data/third_party/boringssl-with-bazel/src/crypto/thread_none.c +0 -8
- data/third_party/boringssl-with-bazel/src/crypto/thread_pthread.c +6 -35
- data/third_party/boringssl-with-bazel/src/crypto/thread_win.c +5 -26
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/pmbtoken.c +14 -18
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/voprf.c +54 -143
- data/third_party/boringssl-with-bazel/src/crypto/x509/by_dir.c +7 -13
- data/third_party/boringssl-with-bazel/src/crypto/x509/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_att.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_lu.c +2 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_req.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_trs.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_v3.c +8 -12
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vfy.c +19 -20
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509name.c +11 -15
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_crl.c +5 -5
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_name.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_pubkey.c +7 -7
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_lib.c +2 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_purp.c +4 -6
- data/third_party/boringssl-with-bazel/src/include/openssl/arm_arch.h +4 -119
- data/third_party/boringssl-with-bazel/src/include/openssl/asm_base.h +207 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +5 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/base.h +2 -116
- data/third_party/boringssl-with-bazel/src/include/openssl/bn.h +0 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/chacha.h +6 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/conf.h +5 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/dsa.h +0 -21
- data/third_party/boringssl-with-bazel/src/include/openssl/ec.h +21 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/ec_key.h +19 -6
- data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +11 -7
- data/third_party/boringssl-with-bazel/src/include/openssl/rand.h +13 -14
- data/third_party/boringssl-with-bazel/src/include/openssl/rsa.h +0 -61
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +127 -81
- data/third_party/boringssl-with-bazel/src/include/openssl/stack.h +224 -209
- data/third_party/boringssl-with-bazel/src/include/openssl/target.h +154 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/thread.h +1 -29
- data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +4 -4
- data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +3 -2
- data/third_party/boringssl-with-bazel/src/ssl/extensions.cc +9 -65
- data/third_party/boringssl-with-bazel/src/ssl/handoff.cc +20 -20
- data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +1 -1
- data/third_party/boringssl-with-bazel/src/ssl/internal.h +4 -11
- data/third_party/boringssl-with-bazel/src/ssl/ssl_cipher.cc +24 -18
- data/third_party/boringssl-with-bazel/src/ssl/ssl_key_share.cc +37 -30
- data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +125 -26
- data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +2 -3
- data/third_party/boringssl-with-bazel/src/third_party/fiat/curve25519_64_adx.h +691 -0
- data/third_party/upb/upb/collections/map.c +3 -3
- metadata +27 -12
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_attributes.cc +0 -42
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_attributes.h +0 -64
- data/src/core/ext/transport/chttp2/transport/stream_map.cc +0 -177
- data/src/core/ext/transport/chttp2/transport/stream_map.h +0 -68
- data/third_party/boringssl-with-bazel/src/crypto/refcount_win.c +0 -89
@@ -56,10 +56,10 @@
|
|
56
56
|
#include "src/core/lib/json/json.h"
|
57
57
|
#include "src/core/lib/json/json_args.h"
|
58
58
|
#include "src/core/lib/json/json_object_loader.h"
|
59
|
+
#include "src/core/lib/load_balancing/delegating_helper.h"
|
59
60
|
#include "src/core/lib/load_balancing/lb_policy.h"
|
60
61
|
#include "src/core/lib/load_balancing/lb_policy_factory.h"
|
61
62
|
#include "src/core/lib/load_balancing/lb_policy_registry.h"
|
62
|
-
#include "src/core/lib/load_balancing/subchannel_interface.h"
|
63
63
|
#include "src/core/lib/resolver/server_address.h"
|
64
64
|
#include "src/core/lib/transport/connectivity_state.h"
|
65
65
|
|
@@ -170,25 +170,23 @@ class WeightedTargetLb : public LoadBalancingPolicy {
|
|
170
170
|
RefCountedPtr<SubchannelPicker> picker() const { return picker_; }
|
171
171
|
|
172
172
|
private:
|
173
|
-
class Helper : public
|
173
|
+
class Helper : public DelegatingChannelControlHelper {
|
174
174
|
public:
|
175
175
|
explicit Helper(RefCountedPtr<WeightedChild> weighted_child)
|
176
176
|
: weighted_child_(std::move(weighted_child)) {}
|
177
177
|
|
178
178
|
~Helper() override { weighted_child_.reset(DEBUG_LOCATION, "Helper"); }
|
179
179
|
|
180
|
-
RefCountedPtr<SubchannelInterface> CreateSubchannel(
|
181
|
-
ServerAddress address, const ChannelArgs& args) override;
|
182
180
|
void UpdateState(grpc_connectivity_state state,
|
183
181
|
const absl::Status& status,
|
184
182
|
RefCountedPtr<SubchannelPicker> picker) override;
|
185
|
-
void RequestReresolution() override;
|
186
|
-
absl::string_view GetAuthority() override;
|
187
|
-
grpc_event_engine::experimental::EventEngine* GetEventEngine() override;
|
188
|
-
void AddTraceEvent(TraceSeverity severity,
|
189
|
-
absl::string_view message) override;
|
190
183
|
|
191
184
|
private:
|
185
|
+
ChannelControlHelper* parent_helper() const override {
|
186
|
+
return weighted_child_->weighted_target_policy_
|
187
|
+
->channel_control_helper();
|
188
|
+
}
|
189
|
+
|
192
190
|
RefCountedPtr<WeightedChild> weighted_child_;
|
193
191
|
};
|
194
192
|
|
@@ -674,14 +672,6 @@ void WeightedTargetLb::WeightedChild::DeactivateLocked() {
|
|
674
672
|
// WeightedTargetLb::WeightedChild::Helper
|
675
673
|
//
|
676
674
|
|
677
|
-
RefCountedPtr<SubchannelInterface>
|
678
|
-
WeightedTargetLb::WeightedChild::Helper::CreateSubchannel(
|
679
|
-
ServerAddress address, const ChannelArgs& args) {
|
680
|
-
if (weighted_child_->weighted_target_policy_->shutting_down_) return nullptr;
|
681
|
-
return weighted_child_->weighted_target_policy_->channel_control_helper()
|
682
|
-
->CreateSubchannel(std::move(address), args);
|
683
|
-
}
|
684
|
-
|
685
675
|
void WeightedTargetLb::WeightedChild::Helper::UpdateState(
|
686
676
|
grpc_connectivity_state state, const absl::Status& status,
|
687
677
|
RefCountedPtr<SubchannelPicker> picker) {
|
@@ -690,30 +680,6 @@ void WeightedTargetLb::WeightedChild::Helper::UpdateState(
|
|
690
680
|
std::move(picker));
|
691
681
|
}
|
692
682
|
|
693
|
-
void WeightedTargetLb::WeightedChild::Helper::RequestReresolution() {
|
694
|
-
if (weighted_child_->weighted_target_policy_->shutting_down_) return;
|
695
|
-
weighted_child_->weighted_target_policy_->channel_control_helper()
|
696
|
-
->RequestReresolution();
|
697
|
-
}
|
698
|
-
|
699
|
-
absl::string_view WeightedTargetLb::WeightedChild::Helper::GetAuthority() {
|
700
|
-
return weighted_child_->weighted_target_policy_->channel_control_helper()
|
701
|
-
->GetAuthority();
|
702
|
-
}
|
703
|
-
|
704
|
-
grpc_event_engine::experimental::EventEngine*
|
705
|
-
WeightedTargetLb::WeightedChild::Helper::GetEventEngine() {
|
706
|
-
return weighted_child_->weighted_target_policy_->channel_control_helper()
|
707
|
-
->GetEventEngine();
|
708
|
-
}
|
709
|
-
|
710
|
-
void WeightedTargetLb::WeightedChild::Helper::AddTraceEvent(
|
711
|
-
TraceSeverity severity, absl::string_view message) {
|
712
|
-
if (weighted_child_->weighted_target_policy_->shutting_down_) return;
|
713
|
-
weighted_child_->weighted_target_policy_->channel_control_helper()
|
714
|
-
->AddTraceEvent(severity, message);
|
715
|
-
}
|
716
|
-
|
717
683
|
//
|
718
684
|
// factory
|
719
685
|
//
|
@@ -32,7 +32,6 @@
|
|
32
32
|
#include "absl/types/optional.h"
|
33
33
|
#include "absl/types/variant.h"
|
34
34
|
|
35
|
-
#include <grpc/event_engine/event_engine.h>
|
36
35
|
#include <grpc/grpc.h>
|
37
36
|
#include <grpc/grpc_security.h>
|
38
37
|
#include <grpc/impl/connectivity_state.h>
|
@@ -61,17 +60,15 @@
|
|
61
60
|
#include "src/core/lib/json/json_args.h"
|
62
61
|
#include "src/core/lib/json/json_object_loader.h"
|
63
62
|
#include "src/core/lib/json/json_writer.h"
|
63
|
+
#include "src/core/lib/load_balancing/delegating_helper.h"
|
64
64
|
#include "src/core/lib/load_balancing/lb_policy.h"
|
65
65
|
#include "src/core/lib/load_balancing/lb_policy_factory.h"
|
66
66
|
#include "src/core/lib/load_balancing/lb_policy_registry.h"
|
67
|
-
#include "src/core/lib/load_balancing/subchannel_interface.h"
|
68
67
|
#include "src/core/lib/matchers/matchers.h"
|
69
|
-
#include "src/core/lib/resolver/server_address.h"
|
70
68
|
#include "src/core/lib/security/credentials/credentials.h"
|
71
69
|
#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h"
|
72
70
|
#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h"
|
73
71
|
#include "src/core/lib/security/credentials/xds/xds_credentials.h"
|
74
|
-
#include "src/core/lib/transport/connectivity_state.h"
|
75
72
|
|
76
73
|
namespace grpc_core {
|
77
74
|
|
@@ -167,22 +164,7 @@ class CdsLb : public LoadBalancingPolicy {
|
|
167
164
|
};
|
168
165
|
|
169
166
|
// Delegating helper to be passed to child policy.
|
170
|
-
|
171
|
-
public:
|
172
|
-
explicit Helper(RefCountedPtr<CdsLb> parent) : parent_(std::move(parent)) {}
|
173
|
-
RefCountedPtr<SubchannelInterface> CreateSubchannel(
|
174
|
-
ServerAddress address, const ChannelArgs& args) override;
|
175
|
-
void UpdateState(grpc_connectivity_state state, const absl::Status& status,
|
176
|
-
RefCountedPtr<SubchannelPicker> picker) override;
|
177
|
-
void RequestReresolution() override;
|
178
|
-
absl::string_view GetAuthority() override;
|
179
|
-
grpc_event_engine::experimental::EventEngine* GetEventEngine() override;
|
180
|
-
void AddTraceEvent(TraceSeverity severity,
|
181
|
-
absl::string_view message) override;
|
182
|
-
|
183
|
-
private:
|
184
|
-
RefCountedPtr<CdsLb> parent_;
|
185
|
-
};
|
167
|
+
using Helper = ParentOwningDelegatingChannelControlHelper<CdsLb>;
|
186
168
|
|
187
169
|
~CdsLb() override;
|
188
170
|
|
@@ -228,52 +210,6 @@ class CdsLb : public LoadBalancingPolicy {
|
|
228
210
|
bool shutting_down_ = false;
|
229
211
|
};
|
230
212
|
|
231
|
-
//
|
232
|
-
// CdsLb::Helper
|
233
|
-
//
|
234
|
-
|
235
|
-
RefCountedPtr<SubchannelInterface> CdsLb::Helper::CreateSubchannel(
|
236
|
-
ServerAddress address, const ChannelArgs& args) {
|
237
|
-
if (parent_->shutting_down_) return nullptr;
|
238
|
-
return parent_->channel_control_helper()->CreateSubchannel(std::move(address),
|
239
|
-
args);
|
240
|
-
}
|
241
|
-
|
242
|
-
void CdsLb::Helper::UpdateState(grpc_connectivity_state state,
|
243
|
-
const absl::Status& status,
|
244
|
-
RefCountedPtr<SubchannelPicker> picker) {
|
245
|
-
if (parent_->shutting_down_ || parent_->child_policy_ == nullptr) return;
|
246
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
|
247
|
-
gpr_log(GPR_INFO, "[cdslb %p] state updated by child: %s (%s)", this,
|
248
|
-
ConnectivityStateName(state), status.ToString().c_str());
|
249
|
-
}
|
250
|
-
parent_->channel_control_helper()->UpdateState(state, status,
|
251
|
-
std::move(picker));
|
252
|
-
}
|
253
|
-
|
254
|
-
void CdsLb::Helper::RequestReresolution() {
|
255
|
-
if (parent_->shutting_down_) return;
|
256
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
|
257
|
-
gpr_log(GPR_INFO, "[cdslb %p] Re-resolution requested from child policy.",
|
258
|
-
parent_.get());
|
259
|
-
}
|
260
|
-
parent_->channel_control_helper()->RequestReresolution();
|
261
|
-
}
|
262
|
-
|
263
|
-
absl::string_view CdsLb::Helper::GetAuthority() {
|
264
|
-
return parent_->channel_control_helper()->GetAuthority();
|
265
|
-
}
|
266
|
-
|
267
|
-
grpc_event_engine::experimental::EventEngine* CdsLb::Helper::GetEventEngine() {
|
268
|
-
return parent_->channel_control_helper()->GetEventEngine();
|
269
|
-
}
|
270
|
-
|
271
|
-
void CdsLb::Helper::AddTraceEvent(TraceSeverity severity,
|
272
|
-
absl::string_view message) {
|
273
|
-
if (parent_->shutting_down_) return;
|
274
|
-
parent_->channel_control_helper()->AddTraceEvent(severity, message);
|
275
|
-
}
|
276
|
-
|
277
213
|
//
|
278
214
|
// CdsLb
|
279
215
|
//
|
@@ -626,7 +562,7 @@ void CdsLb::OnResourceDoesNotExist(const std::string& name) {
|
|
626
562
|
absl::Status CdsLb::UpdateXdsCertificateProvider(
|
627
563
|
const std::string& cluster_name, const XdsClusterResource& cluster_data) {
|
628
564
|
// Early out if channel is not configured to use xds security.
|
629
|
-
auto
|
565
|
+
auto channel_credentials = channel_control_helper()->GetChannelCredentials();
|
630
566
|
if (channel_credentials == nullptr ||
|
631
567
|
channel_credentials->type() != XdsCredentials::Type()) {
|
632
568
|
xds_certificate_provider_ = nullptr;
|
@@ -17,6 +17,10 @@
|
|
17
17
|
#ifndef GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_XDS_XDS_CHANNEL_ARGS_H
|
18
18
|
#define GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_XDS_XDS_CHANNEL_ARGS_H
|
19
19
|
|
20
|
+
#include <grpc/support/port_platform.h>
|
21
|
+
|
22
|
+
#include "src/core/lib/resolver/server_address.h"
|
23
|
+
|
20
24
|
// Channel arg indicating the xDS cluster name.
|
21
25
|
// Set by xds_cluster_impl LB policy and used by GoogleDefaultCredentials.
|
22
26
|
#define GRPC_ARG_XDS_CLUSTER_NAME "grpc.internal.xds_cluster_name"
|
@@ -26,4 +30,8 @@
|
|
26
30
|
#define GRPC_ARG_XDS_LOGICAL_DNS_CLUSTER_FAKE_RESOLVER_RESPONSE_GENERATOR \
|
27
31
|
"grpc.TEST_ONLY.xds_logical_dns_cluster_fake_resolver_response_generator"
|
28
32
|
|
33
|
+
// Channel arg for encoding xDS locality weight.
|
34
|
+
#define GRPC_ARG_XDS_LOCALITY_WEIGHT \
|
35
|
+
GRPC_ARG_NO_SUBCHANNEL_PREFIX "xds_locality_weight"
|
36
|
+
|
29
37
|
#endif // GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_XDS_XDS_CHANNEL_ARGS_H
|
@@ -34,13 +34,11 @@
|
|
34
34
|
#include "absl/types/optional.h"
|
35
35
|
#include "absl/types/variant.h"
|
36
36
|
|
37
|
-
#include <grpc/event_engine/event_engine.h>
|
38
37
|
#include <grpc/impl/connectivity_state.h>
|
39
38
|
#include <grpc/support/log.h>
|
40
39
|
|
41
40
|
#include "src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h"
|
42
41
|
#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
|
43
|
-
#include "src/core/ext/filters/client_channel/lb_policy/xds/xds_attributes.h"
|
44
42
|
#include "src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h"
|
45
43
|
#include "src/core/ext/xds/xds_bootstrap.h"
|
46
44
|
#include "src/core/ext/xds/xds_bootstrap_grpc.h"
|
@@ -61,6 +59,7 @@
|
|
61
59
|
#include "src/core/lib/json/json.h"
|
62
60
|
#include "src/core/lib/json/json_args.h"
|
63
61
|
#include "src/core/lib/json/json_object_loader.h"
|
62
|
+
#include "src/core/lib/load_balancing/delegating_helper.h"
|
64
63
|
#include "src/core/lib/load_balancing/lb_policy.h"
|
65
64
|
#include "src/core/lib/load_balancing/lb_policy_factory.h"
|
66
65
|
#include "src/core/lib/load_balancing/lb_policy_registry.h"
|
@@ -229,27 +228,17 @@ class XdsClusterImplLb : public LoadBalancingPolicy {
|
|
229
228
|
RefCountedPtr<SubchannelPicker> picker_;
|
230
229
|
};
|
231
230
|
|
232
|
-
class Helper
|
231
|
+
class Helper
|
232
|
+
: public ParentOwningDelegatingChannelControlHelper<XdsClusterImplLb> {
|
233
233
|
public:
|
234
234
|
explicit Helper(RefCountedPtr<XdsClusterImplLb> xds_cluster_impl_policy)
|
235
|
-
:
|
236
|
-
|
237
|
-
~Helper() override {
|
238
|
-
xds_cluster_impl_policy_.reset(DEBUG_LOCATION, "Helper");
|
239
|
-
}
|
235
|
+
: ParentOwningDelegatingChannelControlHelper(
|
236
|
+
std::move(xds_cluster_impl_policy)) {}
|
240
237
|
|
241
238
|
RefCountedPtr<SubchannelInterface> CreateSubchannel(
|
242
239
|
ServerAddress address, const ChannelArgs& args) override;
|
243
240
|
void UpdateState(grpc_connectivity_state state, const absl::Status& status,
|
244
241
|
RefCountedPtr<SubchannelPicker> picker) override;
|
245
|
-
void RequestReresolution() override;
|
246
|
-
absl::string_view GetAuthority() override;
|
247
|
-
grpc_event_engine::experimental::EventEngine* GetEventEngine() override;
|
248
|
-
void AddTraceEvent(TraceSeverity severity,
|
249
|
-
absl::string_view message) override;
|
250
|
-
|
251
|
-
private:
|
252
|
-
RefCountedPtr<XdsClusterImplLb> xds_cluster_impl_policy_;
|
253
242
|
};
|
254
243
|
|
255
244
|
~XdsClusterImplLb() override;
|
@@ -606,86 +595,54 @@ absl::Status XdsClusterImplLb::UpdateChildPolicyLocked(
|
|
606
595
|
|
607
596
|
RefCountedPtr<SubchannelInterface> XdsClusterImplLb::Helper::CreateSubchannel(
|
608
597
|
ServerAddress address, const ChannelArgs& args) {
|
609
|
-
if (
|
598
|
+
if (parent()->shutting_down_) return nullptr;
|
610
599
|
// If load reporting is enabled, wrap the subchannel such that it
|
611
600
|
// includes the locality stats object, which will be used by the Picker.
|
612
|
-
if (
|
613
|
-
|
614
|
-
RefCountedPtr<XdsLocalityName> locality_name;
|
615
|
-
auto* attribute = address.GetAttribute(kXdsLocalityNameAttributeKey);
|
616
|
-
if (attribute != nullptr) {
|
617
|
-
const auto* locality_attr =
|
618
|
-
static_cast<const XdsLocalityAttribute*>(attribute);
|
619
|
-
locality_name = locality_attr->locality_name();
|
620
|
-
}
|
601
|
+
if (parent()->config_->lrs_load_reporting_server().has_value()) {
|
602
|
+
auto locality_name = address.args().GetObjectRef<XdsLocalityName>();
|
621
603
|
RefCountedPtr<XdsClusterLocalityStats> locality_stats =
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
xds_cluster_impl_policy_->config_->eds_service_name(),
|
627
|
-
std::move(locality_name));
|
604
|
+
parent()->xds_client_->AddClusterLocalityStats(
|
605
|
+
parent()->config_->lrs_load_reporting_server().value(),
|
606
|
+
parent()->config_->cluster_name(),
|
607
|
+
parent()->config_->eds_service_name(), std::move(locality_name));
|
628
608
|
if (locality_stats != nullptr) {
|
629
609
|
return MakeRefCounted<StatsSubchannelWrapper>(
|
630
|
-
|
610
|
+
parent()->channel_control_helper()->CreateSubchannel(
|
631
611
|
std::move(address), args),
|
632
612
|
std::move(locality_stats));
|
633
613
|
}
|
634
|
-
gpr_log(
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
xds_cluster_impl_policy_->config_->eds_service_name().c_str());
|
614
|
+
gpr_log(
|
615
|
+
GPR_ERROR,
|
616
|
+
"[xds_cluster_impl_lb %p] Failed to get locality stats object for "
|
617
|
+
"LRS server %s, cluster %s, EDS service name %s; load reports will "
|
618
|
+
"not be generated (not wrapping subchannel)",
|
619
|
+
parent(),
|
620
|
+
parent()->config_->lrs_load_reporting_server()->server_uri().c_str(),
|
621
|
+
parent()->config_->cluster_name().c_str(),
|
622
|
+
parent()->config_->eds_service_name().c_str());
|
644
623
|
}
|
645
624
|
// Load reporting not enabled, so don't wrap the subchannel.
|
646
|
-
return
|
625
|
+
return parent()->channel_control_helper()->CreateSubchannel(
|
647
626
|
std::move(address), args);
|
648
627
|
}
|
649
628
|
|
650
629
|
void XdsClusterImplLb::Helper::UpdateState(
|
651
630
|
grpc_connectivity_state state, const absl::Status& status,
|
652
631
|
RefCountedPtr<SubchannelPicker> picker) {
|
653
|
-
if (
|
632
|
+
if (parent()->shutting_down_) return;
|
654
633
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) {
|
655
634
|
gpr_log(GPR_INFO,
|
656
635
|
"[xds_cluster_impl_lb %p] child connectivity state update: "
|
657
|
-
"state=%s (%s) "
|
658
|
-
|
659
|
-
|
660
|
-
status.ToString().c_str(), picker.get());
|
636
|
+
"state=%s (%s) picker=%p",
|
637
|
+
parent(), ConnectivityStateName(state), status.ToString().c_str(),
|
638
|
+
picker.get());
|
661
639
|
}
|
662
640
|
// Save the state and picker.
|
663
|
-
|
664
|
-
|
665
|
-
|
641
|
+
parent()->state_ = state;
|
642
|
+
parent()->status_ = status;
|
643
|
+
parent()->picker_ = std::move(picker);
|
666
644
|
// Wrap the picker and return it to the channel.
|
667
|
-
|
668
|
-
}
|
669
|
-
|
670
|
-
void XdsClusterImplLb::Helper::RequestReresolution() {
|
671
|
-
if (xds_cluster_impl_policy_->shutting_down_) return;
|
672
|
-
xds_cluster_impl_policy_->channel_control_helper()->RequestReresolution();
|
673
|
-
}
|
674
|
-
|
675
|
-
absl::string_view XdsClusterImplLb::Helper::GetAuthority() {
|
676
|
-
return xds_cluster_impl_policy_->channel_control_helper()->GetAuthority();
|
677
|
-
}
|
678
|
-
|
679
|
-
grpc_event_engine::experimental::EventEngine*
|
680
|
-
XdsClusterImplLb::Helper::GetEventEngine() {
|
681
|
-
return xds_cluster_impl_policy_->channel_control_helper()->GetEventEngine();
|
682
|
-
}
|
683
|
-
|
684
|
-
void XdsClusterImplLb::Helper::AddTraceEvent(TraceSeverity severity,
|
685
|
-
absl::string_view message) {
|
686
|
-
if (xds_cluster_impl_policy_->shutting_down_) return;
|
687
|
-
xds_cluster_impl_policy_->channel_control_helper()->AddTraceEvent(severity,
|
688
|
-
message);
|
645
|
+
parent()->MaybeUpdatePickerLocked();
|
689
646
|
}
|
690
647
|
|
691
648
|
//
|
@@ -55,10 +55,10 @@
|
|
55
55
|
#include "src/core/lib/json/json.h"
|
56
56
|
#include "src/core/lib/json/json_args.h"
|
57
57
|
#include "src/core/lib/json/json_object_loader.h"
|
58
|
+
#include "src/core/lib/load_balancing/delegating_helper.h"
|
58
59
|
#include "src/core/lib/load_balancing/lb_policy.h"
|
59
60
|
#include "src/core/lib/load_balancing/lb_policy_factory.h"
|
60
61
|
#include "src/core/lib/load_balancing/lb_policy_registry.h"
|
61
|
-
#include "src/core/lib/load_balancing/subchannel_interface.h"
|
62
62
|
#include "src/core/lib/resolver/server_address.h"
|
63
63
|
#include "src/core/lib/transport/connectivity_state.h"
|
64
64
|
|
@@ -161,7 +161,7 @@ class XdsClusterManagerLb : public LoadBalancingPolicy {
|
|
161
161
|
RefCountedPtr<SubchannelPicker> picker() const { return picker_; }
|
162
162
|
|
163
163
|
private:
|
164
|
-
class Helper : public
|
164
|
+
class Helper : public DelegatingChannelControlHelper {
|
165
165
|
public:
|
166
166
|
explicit Helper(RefCountedPtr<ClusterChild> xds_cluster_manager_child)
|
167
167
|
: xds_cluster_manager_child_(std::move(xds_cluster_manager_child)) {}
|
@@ -170,18 +170,16 @@ class XdsClusterManagerLb : public LoadBalancingPolicy {
|
|
170
170
|
xds_cluster_manager_child_.reset(DEBUG_LOCATION, "Helper");
|
171
171
|
}
|
172
172
|
|
173
|
-
RefCountedPtr<SubchannelInterface> CreateSubchannel(
|
174
|
-
ServerAddress address, const ChannelArgs& args) override;
|
175
173
|
void UpdateState(grpc_connectivity_state state,
|
176
174
|
const absl::Status& status,
|
177
175
|
RefCountedPtr<SubchannelPicker> picker) override;
|
178
|
-
void RequestReresolution() override;
|
179
|
-
absl::string_view GetAuthority() override;
|
180
|
-
EventEngine* GetEventEngine() override;
|
181
|
-
void AddTraceEvent(TraceSeverity severity,
|
182
|
-
absl::string_view message) override;
|
183
176
|
|
184
177
|
private:
|
178
|
+
ChannelControlHelper* parent_helper() const override {
|
179
|
+
return xds_cluster_manager_child_->xds_cluster_manager_policy_
|
180
|
+
->channel_control_helper();
|
181
|
+
}
|
182
|
+
|
185
183
|
RefCountedPtr<ClusterChild> xds_cluster_manager_child_;
|
186
184
|
};
|
187
185
|
|
@@ -556,17 +554,6 @@ void XdsClusterManagerLb::ClusterChild::OnDelayedRemovalTimerLocked() {
|
|
556
554
|
// XdsClusterManagerLb::ClusterChild::Helper
|
557
555
|
//
|
558
556
|
|
559
|
-
RefCountedPtr<SubchannelInterface>
|
560
|
-
XdsClusterManagerLb::ClusterChild::Helper::CreateSubchannel(
|
561
|
-
ServerAddress address, const ChannelArgs& args) {
|
562
|
-
if (xds_cluster_manager_child_->xds_cluster_manager_policy_->shutting_down_) {
|
563
|
-
return nullptr;
|
564
|
-
}
|
565
|
-
return xds_cluster_manager_child_->xds_cluster_manager_policy_
|
566
|
-
->channel_control_helper()
|
567
|
-
->CreateSubchannel(std::move(address), args);
|
568
|
-
}
|
569
|
-
|
570
557
|
void XdsClusterManagerLb::ClusterChild::Helper::UpdateState(
|
571
558
|
grpc_connectivity_state state, const absl::Status& status,
|
572
559
|
RefCountedPtr<SubchannelPicker> picker) {
|
@@ -596,37 +583,6 @@ void XdsClusterManagerLb::ClusterChild::Helper::UpdateState(
|
|
596
583
|
xds_cluster_manager_child_->xds_cluster_manager_policy_->UpdateStateLocked();
|
597
584
|
}
|
598
585
|
|
599
|
-
void XdsClusterManagerLb::ClusterChild::Helper::RequestReresolution() {
|
600
|
-
if (xds_cluster_manager_child_->xds_cluster_manager_policy_->shutting_down_) {
|
601
|
-
return;
|
602
|
-
}
|
603
|
-
xds_cluster_manager_child_->xds_cluster_manager_policy_
|
604
|
-
->channel_control_helper()
|
605
|
-
->RequestReresolution();
|
606
|
-
}
|
607
|
-
|
608
|
-
absl::string_view XdsClusterManagerLb::ClusterChild::Helper::GetAuthority() {
|
609
|
-
return xds_cluster_manager_child_->xds_cluster_manager_policy_
|
610
|
-
->channel_control_helper()
|
611
|
-
->GetAuthority();
|
612
|
-
}
|
613
|
-
|
614
|
-
EventEngine* XdsClusterManagerLb::ClusterChild::Helper::GetEventEngine() {
|
615
|
-
return xds_cluster_manager_child_->xds_cluster_manager_policy_
|
616
|
-
->channel_control_helper()
|
617
|
-
->GetEventEngine();
|
618
|
-
}
|
619
|
-
|
620
|
-
void XdsClusterManagerLb::ClusterChild::Helper::AddTraceEvent(
|
621
|
-
TraceSeverity severity, absl::string_view message) {
|
622
|
-
if (xds_cluster_manager_child_->xds_cluster_manager_policy_->shutting_down_) {
|
623
|
-
return;
|
624
|
-
}
|
625
|
-
xds_cluster_manager_child_->xds_cluster_manager_policy_
|
626
|
-
->channel_control_helper()
|
627
|
-
->AddTraceEvent(severity, message);
|
628
|
-
}
|
629
|
-
|
630
586
|
//
|
631
587
|
// factory
|
632
588
|
//
|
@@ -35,7 +35,6 @@
|
|
35
35
|
#include "absl/strings/string_view.h"
|
36
36
|
#include "absl/types/optional.h"
|
37
37
|
|
38
|
-
#include <grpc/event_engine/event_engine.h>
|
39
38
|
#include <grpc/grpc.h>
|
40
39
|
#include <grpc/impl/connectivity_state.h>
|
41
40
|
#include <grpc/support/json.h>
|
@@ -43,7 +42,6 @@
|
|
43
42
|
|
44
43
|
#include "src/core/ext/filters/client_channel/lb_policy/address_filtering.h"
|
45
44
|
#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
|
46
|
-
#include "src/core/ext/filters/client_channel/lb_policy/xds/xds_attributes.h"
|
47
45
|
#include "src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h"
|
48
46
|
#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
|
49
47
|
#include "src/core/ext/xds/xds_bootstrap.h"
|
@@ -65,14 +63,13 @@
|
|
65
63
|
#include "src/core/lib/json/json_args.h"
|
66
64
|
#include "src/core/lib/json/json_object_loader.h"
|
67
65
|
#include "src/core/lib/json/json_writer.h"
|
66
|
+
#include "src/core/lib/load_balancing/delegating_helper.h"
|
68
67
|
#include "src/core/lib/load_balancing/lb_policy.h"
|
69
68
|
#include "src/core/lib/load_balancing/lb_policy_factory.h"
|
70
69
|
#include "src/core/lib/load_balancing/lb_policy_registry.h"
|
71
|
-
#include "src/core/lib/load_balancing/subchannel_interface.h"
|
72
70
|
#include "src/core/lib/resolver/resolver.h"
|
73
71
|
#include "src/core/lib/resolver/resolver_registry.h"
|
74
72
|
#include "src/core/lib/resolver/server_address.h"
|
75
|
-
#include "src/core/lib/transport/connectivity_state.h"
|
76
73
|
|
77
74
|
#define GRPC_EDS_DEFAULT_FALLBACK_TIMEOUT 10000
|
78
75
|
|
@@ -360,31 +357,18 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
|
|
360
357
|
std::string GetChildPolicyName(size_t priority) const;
|
361
358
|
};
|
362
359
|
|
363
|
-
class Helper : public
|
360
|
+
class Helper : public ParentOwningDelegatingChannelControlHelper<
|
361
|
+
XdsClusterResolverLb> {
|
364
362
|
public:
|
365
363
|
explicit Helper(
|
366
364
|
RefCountedPtr<XdsClusterResolverLb> xds_cluster_resolver_policy)
|
367
|
-
:
|
368
|
-
|
369
|
-
|
370
|
-
~Helper() override {
|
371
|
-
xds_cluster_resolver_policy_.reset(DEBUG_LOCATION, "Helper");
|
372
|
-
}
|
365
|
+
: ParentOwningDelegatingChannelControlHelper(
|
366
|
+
std::move(xds_cluster_resolver_policy)) {}
|
373
367
|
|
374
|
-
RefCountedPtr<SubchannelInterface> CreateSubchannel(
|
375
|
-
ServerAddress address, const ChannelArgs& args) override;
|
376
|
-
void UpdateState(grpc_connectivity_state state, const absl::Status& status,
|
377
|
-
RefCountedPtr<SubchannelPicker> picker) override;
|
378
368
|
// This is a no-op, because we get the addresses from the xds
|
379
369
|
// client, which is a watch-based API.
|
370
|
+
// TODO(roth): Don't we need to propagate this for LOGICAL_DNS clusters?
|
380
371
|
void RequestReresolution() override {}
|
381
|
-
absl::string_view GetAuthority() override;
|
382
|
-
grpc_event_engine::experimental::EventEngine* GetEventEngine() override;
|
383
|
-
void AddTraceEvent(TraceSeverity severity,
|
384
|
-
absl::string_view message) override;
|
385
|
-
|
386
|
-
private:
|
387
|
-
RefCountedPtr<XdsClusterResolverLb> xds_cluster_resolver_policy_;
|
388
372
|
};
|
389
373
|
|
390
374
|
~XdsClusterResolverLb() override;
|
@@ -422,53 +406,6 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
|
|
422
406
|
OrphanablePtr<LoadBalancingPolicy> child_policy_;
|
423
407
|
};
|
424
408
|
|
425
|
-
//
|
426
|
-
// XdsClusterResolverLb::Helper
|
427
|
-
//
|
428
|
-
|
429
|
-
RefCountedPtr<SubchannelInterface>
|
430
|
-
XdsClusterResolverLb::Helper::CreateSubchannel(ServerAddress address,
|
431
|
-
const ChannelArgs& args) {
|
432
|
-
if (xds_cluster_resolver_policy_->shutting_down_) return nullptr;
|
433
|
-
return xds_cluster_resolver_policy_->channel_control_helper()
|
434
|
-
->CreateSubchannel(std::move(address), args);
|
435
|
-
}
|
436
|
-
|
437
|
-
void XdsClusterResolverLb::Helper::UpdateState(
|
438
|
-
grpc_connectivity_state state, const absl::Status& status,
|
439
|
-
RefCountedPtr<SubchannelPicker> picker) {
|
440
|
-
if (xds_cluster_resolver_policy_->shutting_down_ ||
|
441
|
-
xds_cluster_resolver_policy_->child_policy_ == nullptr) {
|
442
|
-
return;
|
443
|
-
}
|
444
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_cluster_resolver_trace)) {
|
445
|
-
gpr_log(GPR_INFO,
|
446
|
-
"[xds_cluster_resolver_lb %p] child policy updated state=%s (%s) "
|
447
|
-
"picker=%p",
|
448
|
-
xds_cluster_resolver_policy_.get(), ConnectivityStateName(state),
|
449
|
-
status.ToString().c_str(), picker.get());
|
450
|
-
}
|
451
|
-
xds_cluster_resolver_policy_->channel_control_helper()->UpdateState(
|
452
|
-
state, status, std::move(picker));
|
453
|
-
}
|
454
|
-
|
455
|
-
absl::string_view XdsClusterResolverLb::Helper::GetAuthority() {
|
456
|
-
return xds_cluster_resolver_policy_->channel_control_helper()->GetAuthority();
|
457
|
-
}
|
458
|
-
|
459
|
-
grpc_event_engine::experimental::EventEngine*
|
460
|
-
XdsClusterResolverLb::Helper::GetEventEngine() {
|
461
|
-
return xds_cluster_resolver_policy_->channel_control_helper()
|
462
|
-
->GetEventEngine();
|
463
|
-
}
|
464
|
-
|
465
|
-
void XdsClusterResolverLb::Helper::AddTraceEvent(TraceSeverity severity,
|
466
|
-
absl::string_view message) {
|
467
|
-
if (xds_cluster_resolver_policy_->shutting_down_) return;
|
468
|
-
xds_cluster_resolver_policy_->channel_control_helper()->AddTraceEvent(
|
469
|
-
severity, message);
|
470
|
-
}
|
471
|
-
|
472
409
|
//
|
473
410
|
// XdsClusterResolverLb::EdsDiscoveryMechanism
|
474
411
|
//
|
@@ -830,25 +767,17 @@ ServerAddressList XdsClusterResolverLb::CreateChildPolicyAddressesLocked() {
|
|
830
767
|
std::vector<std::string> hierarchical_path = {
|
831
768
|
priority_child_name, locality_name->AsHumanReadableString()};
|
832
769
|
for (const auto& endpoint : locality.endpoints) {
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
uint32_t weight = locality.lb_weight;
|
837
|
-
if (weight_attribute != nullptr) {
|
838
|
-
weight = locality.lb_weight * weight_attribute->weight();
|
839
|
-
}
|
770
|
+
uint32_t endpoint_weight =
|
771
|
+
locality.lb_weight *
|
772
|
+
endpoint.args().GetInt(GRPC_ARG_ADDRESS_WEIGHT).value_or(1);
|
840
773
|
addresses.emplace_back(
|
841
|
-
endpoint
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
.
|
846
|
-
|
847
|
-
|
848
|
-
.WithAttribute(
|
849
|
-
ServerAddressWeightAttribute::
|
850
|
-
kServerAddressWeightAttributeKey,
|
851
|
-
std::make_unique<ServerAddressWeightAttribute>(weight)));
|
774
|
+
endpoint.address(),
|
775
|
+
endpoint.args()
|
776
|
+
.SetObject(
|
777
|
+
MakeRefCounted<HierarchicalPathArg>(hierarchical_path))
|
778
|
+
.Set(GRPC_ARG_ADDRESS_WEIGHT, endpoint_weight)
|
779
|
+
.SetObject(locality_name->Ref())
|
780
|
+
.Set(GRPC_ARG_XDS_LOCALITY_WEIGHT, locality.lb_weight));
|
852
781
|
}
|
853
782
|
}
|
854
783
|
}
|