grpc 1.35.0 → 1.36.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 +60 -57
- data/include/grpc/grpc_security.h +16 -11
- data/src/core/ext/filters/client_channel/client_channel.cc +32 -26
- data/src/core/ext/filters/client_channel/client_channel.h +0 -2
- data/src/core/ext/filters/client_channel/config_selector.h +1 -1
- data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +2 -2
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +3 -5
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +1 -2
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +1 -2
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +8 -6
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +289 -170
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h +5 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +1 -3
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +231 -109
- data/src/core/ext/filters/client_channel/resolver.cc +2 -5
- data/src/core/ext/filters/client_channel/resolver.h +1 -12
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +36 -45
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +29 -41
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +16 -14
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +18 -15
- data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +362 -0
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +4 -4
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +22 -74
- data/src/core/ext/filters/client_channel/server_address.cc +6 -0
- data/src/core/ext/filters/client_channel/server_address.h +31 -0
- data/src/core/ext/filters/client_channel/subchannel.cc +2 -2
- data/src/core/ext/filters/max_age/max_age_filter.cc +35 -32
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +1 -1
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +47 -22
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +11 -2
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +11 -1
- data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +62 -18
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +11 -16
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +42 -59
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +15 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +25 -1
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +75 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +9 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +7 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +28 -13
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +11 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +41 -7
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +23 -21
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +122 -77
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +13 -9
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +37 -5
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +11 -9
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +44 -27
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +42 -16
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +106 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +29 -0
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +67 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +13 -16
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +51 -42
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +16 -13
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +50 -18
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +4 -7
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +0 -17
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +30 -23
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +85 -73
- data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c +0 -3
- data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c +0 -3
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c +0 -2
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +0 -1
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +21 -4
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +29 -0
- data/src/core/ext/upb-generated/{udpa/core/v1 → xds/core/v3}/authority.upb.c +5 -5
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +60 -0
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +52 -0
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +143 -0
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +42 -0
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +84 -0
- data/src/core/ext/upb-generated/{udpa/core/v1 → xds/core/v3}/resource.upb.c +9 -9
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +94 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +54 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +166 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +36 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +85 -0
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +168 -171
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +405 -420
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +2 -2
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +12 -9
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +177 -171
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +88 -88
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +153 -153
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c +4 -7
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c +33 -20
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c +56 -59
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +116 -111
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +129 -121
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c +21 -24
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +17 -13
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +747 -724
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c +22 -25
- data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +51 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +369 -376
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c +12 -16
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +112 -108
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +45 -53
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +177 -180
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +92 -102
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c +32 -42
- data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c +30 -40
- data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c +4 -7
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c +38 -44
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c +30 -33
- data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +14 -11
- data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c +42 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c +62 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c +45 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c +49 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c +67 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c +50 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h +35 -0
- data/src/core/ext/xds/xds_api.cc +738 -567
- data/src/core/ext/xds/xds_api.h +46 -84
- data/src/core/ext/xds/xds_bootstrap.cc +59 -40
- data/src/core/ext/xds/xds_bootstrap.h +12 -4
- data/src/core/ext/xds/xds_certificate_provider.cc +180 -74
- data/src/core/ext/xds/xds_certificate_provider.h +83 -44
- data/src/core/ext/xds/xds_client.cc +13 -11
- data/src/core/ext/xds/xds_client.h +3 -0
- data/src/core/ext/xds/xds_client_stats.cc +2 -1
- data/src/core/ext/xds/xds_server_config_fetcher.cc +147 -11
- data/src/core/lib/channel/handshaker.cc +2 -5
- data/src/core/lib/channel/handshaker.h +1 -1
- data/src/core/lib/gpr/log.cc +6 -1
- data/src/core/lib/gprpp/mpscq.cc +2 -2
- data/src/core/lib/gprpp/ref_counted.h +1 -1
- data/src/core/lib/gprpp/sync.h +129 -40
- data/src/core/lib/gprpp/time_util.cc +77 -0
- data/src/core/lib/gprpp/time_util.h +42 -0
- data/src/core/lib/http/httpcli_security_connector.cc +2 -2
- data/src/core/lib/iomgr/ev_apple.cc +10 -7
- data/src/core/lib/iomgr/ev_epollex_linux.cc +4 -4
- data/src/core/lib/iomgr/iomgr_posix.cc +0 -1
- data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +0 -1
- data/src/core/lib/iomgr/sockaddr_utils.cc +1 -1
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +1 -0
- data/src/core/lib/iomgr/tcp_client_posix.cc +1 -1
- data/src/core/lib/iomgr/tcp_posix.cc +4 -4
- data/src/core/lib/security/authorization/matchers.cc +339 -0
- data/src/core/lib/security/authorization/matchers.h +158 -0
- data/src/core/lib/security/authorization/mock_cel/activation.h +1 -1
- data/src/core/lib/security/authorization/mock_cel/cel_value.h +9 -7
- data/src/core/lib/security/credentials/alts/alts_credentials.cc +2 -1
- data/src/core/lib/security/credentials/alts/alts_credentials.h +1 -1
- data/src/core/lib/security/credentials/credentials.h +2 -1
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +1 -1
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +2 -2
- data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +1 -1
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +1 -1
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +1 -1
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +7 -6
- data/src/core/lib/security/credentials/insecure/insecure_credentials.cc +2 -2
- data/src/core/lib/security/credentials/jwt/json_token.cc +0 -3
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +0 -3
- data/src/core/lib/security/credentials/local/local_credentials.cc +2 -1
- data/src/core/lib/security/credentials/local/local_credentials.h +1 -1
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +2 -1
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +1 -1
- data/src/core/lib/security/credentials/tls/tls_credentials.cc +2 -1
- data/src/core/lib/security/credentials/tls/tls_credentials.h +1 -1
- data/src/core/lib/security/credentials/xds/xds_credentials.cc +128 -59
- data/src/core/lib/security/credentials/xds/xds_credentials.h +3 -3
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +5 -5
- data/src/core/lib/security/security_connector/ssl_utils.cc +3 -0
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +26 -14
- data/src/core/lib/security/transport/security_handshaker.cc +1 -3
- data/src/core/lib/slice/slice_intern.cc +1 -1
- data/src/core/lib/surface/init.cc +13 -15
- data/src/core/lib/surface/server.cc +3 -3
- data/src/core/lib/surface/server.h +3 -0
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/metadata.cc +6 -2
- data/src/core/plugin_registry/grpc_plugin_registry.cc +6 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +17 -20
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +16 -21
- data/src/core/tsi/fake_transport_security.cc +1 -1
- data/src/core/tsi/ssl/session_cache/ssl_session.h +0 -3
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +0 -2
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +2 -4
- data/src/core/tsi/ssl_transport_security.cc +0 -3
- data/src/core/tsi/ssl_transport_security.h +0 -3
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +7 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +1 -0
- data/third_party/boringssl-with-bazel/err_data.c +725 -723
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bitstr.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_enum.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_int.c +5 -5
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c +3 -10
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_octet.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_type.c +4 -2
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c +15 -14
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_locl.h +30 -0
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c +28 -79
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c +39 -85
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_fre.c +5 -16
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_new.c +10 -61
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_typ.c +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_utl.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/bio/socket_helper.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/blake2/blake2.c +158 -0
- data/third_party/boringssl-with-bazel/src/crypto/bn_extra/bn_asn1.c +3 -10
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/ber.c +8 -9
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/cbs.c +60 -45
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_chacha20poly1305.c +6 -81
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/internal.h +87 -0
- data/third_party/boringssl-with-bazel/src/crypto/cpu-aarch64-win.c +41 -0
- data/third_party/boringssl-with-bazel/src/crypto/{dh → dh_extra}/dh_asn1.c +0 -0
- data/third_party/boringssl-with-bazel/src/crypto/{dh → dh_extra}/params.c +179 -0
- data/third_party/boringssl-with-bazel/src/crypto/digest_extra/digest_extra.c +25 -0
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_asn1.c +2 -17
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm.c +3 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/bn.c +13 -20
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/div.c +2 -3
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/internal.h +9 -1
- data/third_party/boringssl-with-bazel/src/crypto/{dh → fipsmodule/dh}/check.c +0 -0
- data/third_party/boringssl-with-bazel/src/crypto/{dh → fipsmodule/dh}/dh.c +136 -213
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec.c +12 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec_key.c +9 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/internal.h +28 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/rand.c +128 -38
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/urandom.c +0 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa_impl.c +51 -32
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +147 -0
- data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +18 -29
- data/third_party/boringssl-with-bazel/src/crypto/hpke/internal.h +13 -4
- data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305.c +10 -7
- data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_arm.c +13 -11
- data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_vec.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/passive.c +34 -0
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/rand_extra.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/stack/stack.c +7 -13
- data/third_party/boringssl-with-bazel/src/crypto/x509/rsa_pss.c +5 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_cmp.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_ext.c +10 -7
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_r2x.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_set.c +8 -8
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_v3.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509cset.c +29 -23
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_crl.c +1 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_pkey.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509.c +39 -6
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509a.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_akey.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c +11 -10
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_bitst.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_conf.c +25 -25
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_cpols.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_enum.c +2 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_genn.c +40 -20
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_ia5.c +3 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_lib.c +25 -36
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_prn.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_skey.c +6 -6
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_utl.c +6 -6
- data/third_party/boringssl-with-bazel/src/include/openssl/arm_arch.h +3 -3
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +652 -545
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1t.h +0 -167
- data/third_party/boringssl-with-bazel/src/include/openssl/base.h +10 -5
- data/third_party/boringssl-with-bazel/src/include/openssl/blake2.h +62 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/bytestring.h +22 -7
- data/third_party/boringssl-with-bazel/src/include/openssl/cipher.h +15 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/dh.h +56 -26
- data/third_party/boringssl-with-bazel/src/include/openssl/digest.h +1 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/ec.h +15 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +12 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/rand.h +3 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/span.h +2 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +42 -24
- data/third_party/boringssl-with-bazel/src/include/openssl/tls1.h +27 -8
- data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +287 -98
- data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +139 -36
- data/third_party/boringssl-with-bazel/src/ssl/handshake.cc +4 -3
- data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +11 -20
- data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +10 -5
- data/third_party/boringssl-with-bazel/src/ssl/internal.h +37 -16
- data/third_party/boringssl-with-bazel/src/ssl/s3_lib.cc +0 -1
- data/third_party/boringssl-with-bazel/src/ssl/ssl_asn1.cc +7 -8
- data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +20 -14
- data/third_party/boringssl-with-bazel/src/ssl/ssl_session.cc +7 -8
- data/third_party/boringssl-with-bazel/src/ssl/ssl_transcript.cc +2 -2
- data/third_party/boringssl-with-bazel/src/ssl/t1_enc.cc +5 -7
- data/third_party/boringssl-with-bazel/src/ssl/t1_lib.cc +329 -31
- data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +2 -2
- data/third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc +48 -15
- data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +66 -24
- metadata +77 -65
- data/src/core/ext/upb-generated/udpa/core/v1/authority.upb.h +0 -60
- data/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.c +0 -52
- data/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.h +0 -143
- data/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.c +0 -42
- data/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.h +0 -84
- data/src/core/ext/upb-generated/udpa/core/v1/resource.upb.h +0 -94
- data/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.c +0 -54
- data/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.h +0 -173
- data/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.c +0 -36
- data/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.h +0 -92
- data/src/core/ext/upbdefs-generated/udpa/core/v1/authority.upbdefs.c +0 -42
- data/src/core/ext/upbdefs-generated/udpa/core/v1/authority.upbdefs.h +0 -35
- data/src/core/ext/upbdefs-generated/udpa/core/v1/collection_entry.upbdefs.c +0 -62
- data/src/core/ext/upbdefs-generated/udpa/core/v1/collection_entry.upbdefs.h +0 -40
- data/src/core/ext/upbdefs-generated/udpa/core/v1/context_params.upbdefs.c +0 -45
- data/src/core/ext/upbdefs-generated/udpa/core/v1/context_params.upbdefs.h +0 -40
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource.upbdefs.c +0 -49
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource.upbdefs.h +0 -35
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_locator.upbdefs.c +0 -68
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_locator.upbdefs.h +0 -40
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_name.upbdefs.c +0 -51
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_name.upbdefs.h +0 -35
- data/src/core/lib/iomgr/iomgr_posix.h +0 -26
@@ -21,4 +21,9 @@
|
|
21
21
|
// Set by xds_cluster_impl LB policy and used by GoogleDefaultCredentials.
|
22
22
|
#define GRPC_ARG_XDS_CLUSTER_NAME "grpc.internal.xds_cluster_name"
|
23
23
|
|
24
|
+
// For testing purpose, this channel arg indicating xds_cluster_resolver LB
|
25
|
+
// policy should use the fake DNS resolver to resolve logical dns cluster.
|
26
|
+
#define GRPC_ARG_XDS_LOGICAL_DNS_CLUSTER_FAKE_RESOLVER_RESPONSE_GENERATOR \
|
27
|
+
"grpc.internal.xds_logical_dns_cluster_fake_resolver_response_generator"
|
28
|
+
|
24
29
|
#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_XDS_XDS_CHANNEL_ARGS_H
|
@@ -145,9 +145,7 @@ class XdsClusterImplLbConfig : public LoadBalancingPolicy::Config {
|
|
145
145
|
const absl::optional<std::string>& lrs_load_reporting_server_name() const {
|
146
146
|
return lrs_load_reporting_server_name_;
|
147
147
|
};
|
148
|
-
|
149
|
-
return max_concurrent_requests_;
|
150
|
-
}
|
148
|
+
uint32_t max_concurrent_requests() const { return max_concurrent_requests_; }
|
151
149
|
RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config() const {
|
152
150
|
return drop_config_;
|
153
151
|
}
|
@@ -29,8 +29,10 @@
|
|
29
29
|
#include "src/core/ext/filters/client_channel/lb_policy/address_filtering.h"
|
30
30
|
#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
|
31
31
|
#include "src/core/ext/filters/client_channel/lb_policy/xds/xds.h"
|
32
|
+
#include "src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h"
|
32
33
|
#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
|
33
34
|
#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
|
35
|
+
#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
|
34
36
|
#include "src/core/ext/filters/client_channel/resolver_registry.h"
|
35
37
|
#include "src/core/ext/filters/client_channel/server_address.h"
|
36
38
|
#include "src/core/ext/xds/xds_channel_args.h"
|
@@ -80,28 +82,20 @@ class XdsClusterResolverLbConfig : public LoadBalancingPolicy::Config {
|
|
80
82
|
};
|
81
83
|
|
82
84
|
XdsClusterResolverLbConfig(
|
83
|
-
std::vector<DiscoveryMechanism> discovery_mechanisms,
|
84
|
-
Json locality_picking_policy, Json endpoint_picking_policy)
|
85
|
+
std::vector<DiscoveryMechanism> discovery_mechanisms, Json xds_lb_policy)
|
85
86
|
: discovery_mechanisms_(std::move(discovery_mechanisms)),
|
86
|
-
|
87
|
-
endpoint_picking_policy_(std::move(endpoint_picking_policy)) {}
|
87
|
+
xds_lb_policy_(std::move(xds_lb_policy)) {}
|
88
88
|
|
89
89
|
const char* name() const override { return kXdsClusterResolver; }
|
90
|
-
|
91
90
|
const std::vector<DiscoveryMechanism>& discovery_mechanisms() const {
|
92
91
|
return discovery_mechanisms_;
|
93
92
|
}
|
94
|
-
|
95
|
-
|
96
|
-
}
|
97
|
-
const Json& endpoint_picking_policy() const {
|
98
|
-
return endpoint_picking_policy_;
|
99
|
-
}
|
93
|
+
|
94
|
+
const Json& xds_lb_policy() const { return xds_lb_policy_; }
|
100
95
|
|
101
96
|
private:
|
102
97
|
std::vector<DiscoveryMechanism> discovery_mechanisms_;
|
103
|
-
Json
|
104
|
-
Json endpoint_picking_policy_;
|
98
|
+
Json xds_lb_policy_;
|
105
99
|
};
|
106
100
|
|
107
101
|
// Xds Cluster Resolver LB policy.
|
@@ -113,6 +107,7 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
|
|
113
107
|
|
114
108
|
void UpdateLocked(UpdateArgs args) override;
|
115
109
|
void ResetBackoffLocked() override;
|
110
|
+
void ExitIdleLocked() override;
|
116
111
|
|
117
112
|
private:
|
118
113
|
// Discovery Mechanism Base class
|
@@ -132,6 +127,8 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
|
|
132
127
|
: parent_(std::move(xds_cluster_resolver_lb)), index_(index) {}
|
133
128
|
virtual void Start() = 0;
|
134
129
|
void Orphan() override = 0;
|
130
|
+
virtual Json::Array override_child_policy() = 0;
|
131
|
+
virtual bool disable_reresolution() = 0;
|
135
132
|
|
136
133
|
// Caller must ensure that config_ is set before calling.
|
137
134
|
const absl::string_view GetXdsClusterResolverResourceName() const {
|
@@ -172,6 +169,8 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
|
|
172
169
|
: DiscoveryMechanism(std::move(xds_cluster_resolver_lb), index) {}
|
173
170
|
void Start() override;
|
174
171
|
void Orphan() override;
|
172
|
+
Json::Array override_child_policy() override { return Json::Array{}; }
|
173
|
+
bool disable_reresolution() override { return true; }
|
175
174
|
|
176
175
|
private:
|
177
176
|
class EndpointWatcher : public XdsClient::EndpointWatcherInterface {
|
@@ -230,6 +229,14 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
|
|
230
229
|
: DiscoveryMechanism(std::move(xds_cluster_resolver_lb), index) {}
|
231
230
|
void Start() override;
|
232
231
|
void Orphan() override;
|
232
|
+
Json::Array override_child_policy() override {
|
233
|
+
return Json::Array{
|
234
|
+
Json::Object{
|
235
|
+
{"pick_first", Json::Object()},
|
236
|
+
},
|
237
|
+
};
|
238
|
+
}
|
239
|
+
bool disable_reresolution() override { return false; };
|
233
240
|
|
234
241
|
private:
|
235
242
|
class ResolverResultHandler : public Resolver::ResultHandler {
|
@@ -469,11 +476,26 @@ void XdsClusterResolverLb::EdsDiscoveryMechanism::EndpointWatcher::Notifier::
|
|
469
476
|
//
|
470
477
|
|
471
478
|
void XdsClusterResolverLb::LogicalDNSDiscoveryMechanism::Start() {
|
479
|
+
std::string target = parent()->server_name_;
|
480
|
+
grpc_channel_args* args = nullptr;
|
481
|
+
FakeResolverResponseGenerator* fake_resolver_response_generator =
|
482
|
+
grpc_channel_args_find_pointer<FakeResolverResponseGenerator>(
|
483
|
+
parent()->args_,
|
484
|
+
GRPC_ARG_XDS_LOGICAL_DNS_CLUSTER_FAKE_RESOLVER_RESPONSE_GENERATOR);
|
485
|
+
if (fake_resolver_response_generator != nullptr) {
|
486
|
+
target = absl::StrCat("fake:", target);
|
487
|
+
grpc_arg new_arg = FakeResolverResponseGenerator::MakeChannelArg(
|
488
|
+
fake_resolver_response_generator);
|
489
|
+
args = grpc_channel_args_copy_and_add(parent()->args_, &new_arg, 1);
|
490
|
+
} else {
|
491
|
+
args = grpc_channel_args_copy(parent()->args_);
|
492
|
+
}
|
472
493
|
resolver_ = ResolverRegistry::CreateResolver(
|
473
|
-
|
474
|
-
|
494
|
+
target.c_str(), args, parent()->interested_parties(),
|
495
|
+
parent()->work_serializer(),
|
475
496
|
absl::make_unique<ResolverResultHandler>(
|
476
497
|
Ref(DEBUG_LOCATION, "LogicalDNSDiscoveryMechanism")));
|
498
|
+
grpc_channel_args_destroy(args);
|
477
499
|
if (resolver_ == nullptr) {
|
478
500
|
parent()->OnResourceDoesNotExist(index());
|
479
501
|
return;
|
@@ -509,9 +531,11 @@ void XdsClusterResolverLb::LogicalDNSDiscoveryMechanism::ResolverResultHandler::
|
|
509
531
|
XdsApi::EdsUpdate update;
|
510
532
|
XdsApi::EdsUpdate::Priority::Locality locality;
|
511
533
|
locality.name = MakeRefCounted<XdsLocalityName>("", "", "");
|
534
|
+
locality.lb_weight = 1;
|
512
535
|
locality.endpoints = std::move(result.addresses);
|
513
|
-
|
514
|
-
|
536
|
+
XdsApi::EdsUpdate::Priority priority;
|
537
|
+
priority.localities.emplace(locality.name.get(), std::move(locality));
|
538
|
+
update.priorities.emplace_back(std::move(priority));
|
515
539
|
discovery_mechanism_->parent()->OnEndpointChanged(
|
516
540
|
discovery_mechanism_->index(), std::move(update));
|
517
541
|
}
|
@@ -655,6 +679,10 @@ void XdsClusterResolverLb::ResetBackoffLocked() {
|
|
655
679
|
}
|
656
680
|
}
|
657
681
|
|
682
|
+
void XdsClusterResolverLb::ExitIdleLocked() {
|
683
|
+
if (child_policy_ != nullptr) child_policy_->ExitIdleLocked();
|
684
|
+
}
|
685
|
+
|
658
686
|
void XdsClusterResolverLb::OnEndpointChanged(size_t index,
|
659
687
|
XdsApi::EdsUpdate update) {
|
660
688
|
if (shutting_down_) return;
|
@@ -673,10 +701,17 @@ void XdsClusterResolverLb::OnEndpointChanged(size_t index,
|
|
673
701
|
discovery_mechanisms_[index].pending_priority_list =
|
674
702
|
std::move(update.priorities);
|
675
703
|
discovery_mechanisms_[index].first_update_received = true;
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
704
|
+
// If any discovery mechanism has not received its first update,
|
705
|
+
// wait until that happens before creating the child policy.
|
706
|
+
// TODO(roth): If this becomes problematic in the future (e.g., a
|
707
|
+
// secondary discovery mechanism delaying us from starting up at all),
|
708
|
+
// we can consider some sort of optimization whereby we can create the
|
709
|
+
// priority policy with only a subset of its children. But we need to
|
710
|
+
// make sure not to get into a situation where the priority policy
|
711
|
+
// will put the channel into TRANSIENT_FAILURE instead of CONNECTING
|
712
|
+
// while we're still waiting for the other discovery mechanism(s).
|
713
|
+
for (DiscoveryMechanismEntry& mechanism : discovery_mechanisms_) {
|
714
|
+
if (!mechanism.first_update_received) return;
|
680
715
|
}
|
681
716
|
// Construct new priority list.
|
682
717
|
XdsApi::EdsUpdate::PriorityList priority_list;
|
@@ -813,7 +848,11 @@ ServerAddressList XdsClusterResolverLb::CreateChildPolicyAddressesLocked() {
|
|
813
848
|
MakeHierarchicalPathAttribute(hierarchical_path))
|
814
849
|
.WithAttribute(kXdsLocalityNameAttributeKey,
|
815
850
|
absl::make_unique<XdsLocalityAttribute>(
|
816
|
-
locality_name->Ref()))
|
851
|
+
locality_name->Ref()))
|
852
|
+
.WithAttribute(ServerAddressWeightAttribute::
|
853
|
+
kServerAddressWeightAttributeKey,
|
854
|
+
absl::make_unique<ServerAddressWeightAttribute>(
|
855
|
+
locality.lb_weight)));
|
817
856
|
}
|
818
857
|
}
|
819
858
|
}
|
@@ -825,53 +864,76 @@ XdsClusterResolverLb::CreateChildPolicyConfigLocked() {
|
|
825
864
|
Json::Object priority_children;
|
826
865
|
Json::Array priority_priorities;
|
827
866
|
// Setting up index to iterate through the discovery mechanisms and keeping
|
828
|
-
// track the discovery_mechanism each
|
867
|
+
// track the discovery_mechanism each priority belongs to.
|
829
868
|
size_t discovery_index = 0;
|
830
869
|
// Setting up num_priorities_remaining to track the priorities in each
|
831
870
|
// discovery_mechanism.
|
832
871
|
size_t num_priorities_remaining_in_discovery =
|
833
872
|
discovery_mechanisms_[discovery_index].num_priorities;
|
834
873
|
for (size_t priority = 0; priority < priority_list_.size(); ++priority) {
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
discovery_mechanisms_[discovery_index].num_priorities;
|
874
|
+
Json child_policy;
|
875
|
+
if (!discovery_mechanisms_[discovery_index]
|
876
|
+
.discovery_mechanism->override_child_policy()
|
877
|
+
.empty()) {
|
878
|
+
child_policy = discovery_mechanisms_[discovery_index]
|
879
|
+
.discovery_mechanism->override_child_policy();
|
842
880
|
} else {
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
881
|
+
const auto& xds_lb_policy = config_->xds_lb_policy().object_value();
|
882
|
+
if (xds_lb_policy.find("ROUND_ROBIN") != xds_lb_policy.end()) {
|
883
|
+
const auto& localities = priority_list_[priority].localities;
|
884
|
+
Json::Object weighted_targets;
|
885
|
+
for (const auto& p : localities) {
|
886
|
+
XdsLocalityName* locality_name = p.first;
|
887
|
+
const auto& locality = p.second;
|
888
|
+
// Construct JSON object containing locality name.
|
889
|
+
Json::Object locality_name_json;
|
890
|
+
if (!locality_name->region().empty()) {
|
891
|
+
locality_name_json["region"] = locality_name->region();
|
892
|
+
}
|
893
|
+
if (!locality_name->zone().empty()) {
|
894
|
+
locality_name_json["zone"] = locality_name->zone();
|
895
|
+
}
|
896
|
+
if (!locality_name->sub_zone().empty()) {
|
897
|
+
locality_name_json["subzone"] = locality_name->sub_zone();
|
898
|
+
}
|
899
|
+
// Add weighted target entry.
|
900
|
+
weighted_targets[locality_name->AsHumanReadableString()] =
|
901
|
+
Json::Object{
|
902
|
+
{"weight", locality.lb_weight},
|
903
|
+
{"childPolicy",
|
904
|
+
Json::Array{
|
905
|
+
Json::Object{
|
906
|
+
{"round_robin", Json::Object()},
|
907
|
+
},
|
908
|
+
}},
|
909
|
+
};
|
910
|
+
}
|
911
|
+
// Construct locality-picking policy.
|
912
|
+
// Start with field from our config and add the "targets" field.
|
913
|
+
child_policy = Json::Array{
|
914
|
+
Json::Object{
|
915
|
+
{"weighted_target_experimental",
|
916
|
+
Json::Object{
|
917
|
+
{"targets", Json::Object()},
|
918
|
+
}},
|
919
|
+
},
|
920
|
+
};
|
921
|
+
Json::Object& config =
|
922
|
+
*(*child_policy.mutable_array())[0].mutable_object();
|
923
|
+
auto it = config.begin();
|
924
|
+
GPR_ASSERT(it != config.end());
|
925
|
+
(*it->second.mutable_object())["targets"] = std::move(weighted_targets);
|
926
|
+
} else {
|
927
|
+
auto it = xds_lb_policy.find("RING_HASH");
|
928
|
+
GPR_ASSERT(it != xds_lb_policy.end());
|
929
|
+
Json::Object ring_hash_experimental_policy = it->second.object_value();
|
930
|
+
child_policy = Json::Array{
|
931
|
+
Json::Object{
|
932
|
+
{"ring_hash_experimental", ring_hash_experimental_policy},
|
933
|
+
},
|
934
|
+
};
|
860
935
|
}
|
861
|
-
// Add weighted target entry.
|
862
|
-
weighted_targets[locality_name->AsHumanReadableString()] = Json::Object{
|
863
|
-
{"weight", locality.lb_weight},
|
864
|
-
{"childPolicy", config_->endpoint_picking_policy()},
|
865
|
-
};
|
866
936
|
}
|
867
|
-
// Construct locality-picking policy.
|
868
|
-
// Start with field from our config and add the "targets" field.
|
869
|
-
Json locality_picking_config = config_->locality_picking_policy();
|
870
|
-
Json::Object& config =
|
871
|
-
*(*locality_picking_config.mutable_array())[0].mutable_object();
|
872
|
-
auto it = config.begin();
|
873
|
-
GPR_ASSERT(it != config.end());
|
874
|
-
(*it->second.mutable_object())["targets"] = std::move(weighted_targets);
|
875
937
|
// Wrap it in the drop policy.
|
876
938
|
Json::Array drop_categories;
|
877
939
|
if (discovery_mechanisms_[discovery_index].drop_config != nullptr) {
|
@@ -887,7 +949,7 @@ XdsClusterResolverLb::CreateChildPolicyConfigLocked() {
|
|
887
949
|
.discovery_mechanism->GetLrsClusterKey();
|
888
950
|
Json::Object xds_cluster_impl_config = {
|
889
951
|
{"clusterName", std::string(lrs_key.first)},
|
890
|
-
{"childPolicy", std::move(
|
952
|
+
{"childPolicy", std::move(child_policy)},
|
891
953
|
{"dropCategories", std::move(drop_categories)},
|
892
954
|
{"maxConcurrentRequests",
|
893
955
|
config_->discovery_mechanisms()[discovery_index]
|
@@ -909,10 +971,24 @@ XdsClusterResolverLb::CreateChildPolicyConfigLocked() {
|
|
909
971
|
const size_t child_number = priority_child_numbers_[priority];
|
910
972
|
std::string child_name = absl::StrCat("child", child_number);
|
911
973
|
priority_priorities.emplace_back(child_name);
|
912
|
-
|
974
|
+
Json::Object child_config = {
|
913
975
|
{"config", std::move(locality_picking_policy)},
|
914
|
-
{"ignore_reresolution_requests", true},
|
915
976
|
};
|
977
|
+
if (discovery_mechanisms_[discovery_index]
|
978
|
+
.discovery_mechanism->disable_reresolution()) {
|
979
|
+
child_config["ignore_reresolution_requests"] = true;
|
980
|
+
}
|
981
|
+
priority_children[child_name] = std::move(child_config);
|
982
|
+
// Each priority in the priority_list_ should correspond to a priority in a
|
983
|
+
// discovery mechanism in discovery_mechanisms_ (both in the same order).
|
984
|
+
// Keeping track of the discovery_mechanism each priority belongs to.
|
985
|
+
--num_priorities_remaining_in_discovery;
|
986
|
+
while (num_priorities_remaining_in_discovery == 0 &&
|
987
|
+
discovery_index < discovery_mechanisms_.size() - 1) {
|
988
|
+
++discovery_index;
|
989
|
+
num_priorities_remaining_in_discovery =
|
990
|
+
discovery_mechanisms_[discovery_index].num_priorities;
|
991
|
+
}
|
916
992
|
}
|
917
993
|
// There should be matching number of priorities in discovery_mechanisms_ and
|
918
994
|
// in priority_list_; therefore at the end of looping through all the
|
@@ -1077,58 +1153,104 @@ class XdsClusterResolverLbFactory : public LoadBalancingPolicyFactory {
|
|
1077
1153
|
discovery_mechanisms.emplace_back(std::move(discovery_mechanism));
|
1078
1154
|
}
|
1079
1155
|
}
|
1080
|
-
// Locality-picking policy.
|
1081
|
-
Json locality_picking_policy;
|
1082
|
-
it = json.object_value().find("localityPickingPolicy");
|
1083
|
-
if (it == json.object_value().end()) {
|
1084
|
-
locality_picking_policy = Json::Array{
|
1085
|
-
Json::Object{
|
1086
|
-
{"weighted_target_experimental",
|
1087
|
-
Json::Object{
|
1088
|
-
{"targets", Json::Object()},
|
1089
|
-
}},
|
1090
|
-
},
|
1091
|
-
};
|
1092
|
-
} else {
|
1093
|
-
locality_picking_policy = it->second;
|
1094
|
-
}
|
1095
|
-
grpc_error* parse_error = GRPC_ERROR_NONE;
|
1096
|
-
if (LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
|
1097
|
-
locality_picking_policy, &parse_error) == nullptr) {
|
1098
|
-
GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
|
1099
|
-
error_list.push_back(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
|
1100
|
-
"localityPickingPolicy", &parse_error, 1));
|
1101
|
-
GRPC_ERROR_UNREF(parse_error);
|
1102
|
-
}
|
1103
|
-
// Endpoint-picking policy. Called "childPolicy" for xds policy.
|
1104
|
-
Json endpoint_picking_policy;
|
1105
|
-
it = json.object_value().find("endpointPickingPolicy");
|
1106
|
-
if (it == json.object_value().end()) {
|
1107
|
-
endpoint_picking_policy = Json::Array{
|
1108
|
-
Json::Object{
|
1109
|
-
{"round_robin", Json::Object()},
|
1110
|
-
},
|
1111
|
-
};
|
1112
|
-
} else {
|
1113
|
-
endpoint_picking_policy = it->second;
|
1114
|
-
}
|
1115
|
-
parse_error = GRPC_ERROR_NONE;
|
1116
|
-
if (LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
|
1117
|
-
endpoint_picking_policy, &parse_error) == nullptr) {
|
1118
|
-
GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
|
1119
|
-
error_list.push_back(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
|
1120
|
-
"endpointPickingPolicy", &parse_error, 1));
|
1121
|
-
GRPC_ERROR_UNREF(parse_error);
|
1122
|
-
}
|
1123
1156
|
if (discovery_mechanisms.empty()) {
|
1124
1157
|
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
1125
1158
|
"field:discovery_mechanism error:list is missing or empty"));
|
1126
1159
|
}
|
1160
|
+
Json xds_lb_policy = Json::Object{
|
1161
|
+
{"ROUND_ROBIN", Json::Object()},
|
1162
|
+
};
|
1163
|
+
it = json.object_value().find("xdsLbPolicy");
|
1164
|
+
if (it != json.object_value().end()) {
|
1165
|
+
if (it->second.type() != Json::Type::ARRAY) {
|
1166
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
1167
|
+
"field:xdsLbPolicy error:type should be array"));
|
1168
|
+
} else {
|
1169
|
+
const Json::Array& array = it->second.array_value();
|
1170
|
+
for (size_t i = 0; i < array.size(); ++i) {
|
1171
|
+
if (array[i].type() != Json::Type::OBJECT) {
|
1172
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
1173
|
+
"field:xdsLbPolicy error:element should be of type object"));
|
1174
|
+
continue;
|
1175
|
+
}
|
1176
|
+
const Json::Object& policy = array[i].object_value();
|
1177
|
+
auto policy_it = policy.find("ROUND_ROBIN");
|
1178
|
+
if (policy_it != policy.end()) {
|
1179
|
+
if (policy_it->second.type() != Json::Type::OBJECT) {
|
1180
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
1181
|
+
"field:ROUND_ROBIN error:type should be object"));
|
1182
|
+
}
|
1183
|
+
break;
|
1184
|
+
}
|
1185
|
+
policy_it = policy.find("RING_HASH");
|
1186
|
+
if (policy_it != policy.end()) {
|
1187
|
+
if (policy_it->second.type() != Json::Type::OBJECT) {
|
1188
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
1189
|
+
"field:RING_HASH error:type should be object"));
|
1190
|
+
continue;
|
1191
|
+
}
|
1192
|
+
// TODO(donnadionne): Move this to a method in
|
1193
|
+
// ring_hash_experimental and call it here.
|
1194
|
+
const Json::Object& ring_hash = policy_it->second.object_value();
|
1195
|
+
xds_lb_policy = array[i];
|
1196
|
+
size_t min_ring_size = 1024;
|
1197
|
+
size_t max_ring_size = 8388608;
|
1198
|
+
auto ring_hash_it = ring_hash.find("min_ring_size");
|
1199
|
+
if (ring_hash_it == ring_hash.end()) {
|
1200
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
1201
|
+
"field:min_ring_size missing"));
|
1202
|
+
} else if (ring_hash_it->second.type() != Json::Type::NUMBER) {
|
1203
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
1204
|
+
"field:min_ring_size error: should be of "
|
1205
|
+
"number"));
|
1206
|
+
} else {
|
1207
|
+
min_ring_size = gpr_parse_nonnegative_int(
|
1208
|
+
ring_hash_it->second.string_value().c_str());
|
1209
|
+
}
|
1210
|
+
ring_hash_it = ring_hash.find("max_ring_size");
|
1211
|
+
if (ring_hash_it == ring_hash.end()) {
|
1212
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
1213
|
+
"field:max_ring_size missing"));
|
1214
|
+
} else if (ring_hash_it->second.type() != Json::Type::NUMBER) {
|
1215
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
1216
|
+
"field:max_ring_size error: should be of "
|
1217
|
+
"number"));
|
1218
|
+
} else {
|
1219
|
+
max_ring_size = gpr_parse_nonnegative_int(
|
1220
|
+
ring_hash_it->second.string_value().c_str());
|
1221
|
+
}
|
1222
|
+
if (min_ring_size <= 0 || min_ring_size > 8388608 ||
|
1223
|
+
max_ring_size <= 0 || max_ring_size > 8388608 ||
|
1224
|
+
min_ring_size > max_ring_size) {
|
1225
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
1226
|
+
"field:max_ring_size and or min_ring_size error: "
|
1227
|
+
"values need to be in the range of 1 to 8388608 "
|
1228
|
+
"and max_ring_size cannot be smaller than "
|
1229
|
+
"min_ring_size"));
|
1230
|
+
}
|
1231
|
+
ring_hash_it = ring_hash.find("hash_function");
|
1232
|
+
if (ring_hash_it == ring_hash.end()) {
|
1233
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
1234
|
+
"field:hash_function missing"));
|
1235
|
+
} else if (ring_hash_it->second.type() != Json::Type::STRING) {
|
1236
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
1237
|
+
"field:hash_function error: should be a "
|
1238
|
+
"string"));
|
1239
|
+
} else if (ring_hash_it->second.string_value() != "XX_HASH" &&
|
1240
|
+
ring_hash_it->second.string_value() != "MURMUR_HASH_2") {
|
1241
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
1242
|
+
"field:hash_function error: unsupported "
|
1243
|
+
"hash_function"));
|
1244
|
+
}
|
1245
|
+
break;
|
1246
|
+
}
|
1247
|
+
}
|
1248
|
+
}
|
1249
|
+
}
|
1127
1250
|
// Construct config.
|
1128
1251
|
if (error_list.empty()) {
|
1129
1252
|
return MakeRefCounted<XdsClusterResolverLbConfig>(
|
1130
|
-
std::move(discovery_mechanisms), std::move(
|
1131
|
-
std::move(endpoint_picking_policy));
|
1253
|
+
std::move(discovery_mechanisms), std::move(xds_lb_policy));
|
1132
1254
|
} else {
|
1133
1255
|
*error = GRPC_ERROR_CREATE_FROM_VECTOR(
|
1134
1256
|
"xds_cluster_resolver_experimental LB policy config", &error_list);
|
@@ -1236,7 +1358,7 @@ class XdsClusterResolverLbFactory : public LoadBalancingPolicyFactory {
|
|
1236
1358
|
}
|
1237
1359
|
|
1238
1360
|
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
|
1239
|
-
const char* name
|
1361
|
+
const char* /*name*/, LoadBalancingPolicy::Args args) const override {
|
1240
1362
|
return MakeOrphanable<XdsClusterResolverLb>(xds_client_, std::move(args));
|
1241
1363
|
}
|
1242
1364
|
|