grpc 1.27.0 → 1.28.0.pre2
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 +707 -629
- data/include/grpc/impl/codegen/grpc_types.h +5 -0
- data/include/grpc/impl/codegen/port_platform.h +7 -0
- data/include/grpc/impl/codegen/sync.h +5 -3
- data/include/grpc/impl/codegen/sync_abseil.h +36 -0
- data/include/grpc/module.modulemap +3 -0
- data/include/grpc/support/sync_abseil.h +26 -0
- data/src/core/ext/filters/client_channel/client_channel.cc +47 -29
- data/src/core/ext/filters/client_channel/client_channel_channelz.cc +31 -47
- data/src/core/ext/filters/client_channel/client_channel_channelz.h +1 -3
- data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +1 -1
- data/src/core/ext/filters/client_channel/http_proxy.cc +4 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +21 -28
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +18 -21
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +9 -13
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +46 -72
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc +413 -422
- data/src/core/ext/filters/client_channel/lb_policy_factory.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy_registry.cc +43 -75
- data/src/core/ext/filters/client_channel/lb_policy_registry.h +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +57 -70
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +3 -3
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +2 -2
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +3 -3
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +4 -2
- data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +228 -286
- data/src/core/ext/filters/client_channel/resolver_result_parsing.h +2 -2
- data/src/core/ext/filters/client_channel/resolving_lb_policy.cc +13 -14
- data/src/core/ext/filters/client_channel/resolving_lb_policy.h +5 -7
- data/src/core/ext/filters/client_channel/service_config.cc +91 -160
- data/src/core/ext/filters/client_channel/service_config.h +14 -21
- data/src/core/ext/filters/client_channel/xds/xds_api.cc +581 -251
- data/src/core/ext/filters/client_channel/xds/xds_api.h +189 -151
- data/src/core/ext/filters/client_channel/xds/xds_bootstrap.cc +133 -350
- data/src/core/ext/filters/client_channel/xds/xds_bootstrap.h +18 -39
- data/src/core/ext/filters/client_channel/xds/xds_channel.h +3 -1
- data/src/core/ext/filters/client_channel/xds/xds_channel_secure.cc +12 -9
- data/src/core/ext/filters/client_channel/xds/xds_client.cc +559 -242
- data/src/core/ext/filters/client_channel/xds/xds_client.h +54 -34
- data/src/core/ext/filters/client_channel/xds/xds_client_stats.cc +53 -128
- data/src/core/ext/filters/client_channel/xds/xds_client_stats.h +105 -132
- data/src/core/ext/filters/message_size/message_size_filter.cc +32 -35
- data/src/core/ext/filters/message_size/message_size_filter.h +1 -1
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +3 -6
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +4 -6
- data/src/core/ext/transport/chttp2/transport/writing.cc +1 -1
- data/src/core/ext/transport/inproc/inproc_transport.cc +22 -42
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +17 -0
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +30 -0
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +27 -0
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +54 -0
- data/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c +46 -21
- data/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h +116 -29
- data/src/core/ext/upb-generated/envoy/api/v2/cds.upb.c +4 -362
- data/src/core/ext/upb-generated/envoy/api/v2/cds.upb.h +14 -1337
- data/src/core/ext/upb-generated/envoy/api/v2/cluster.upb.c +390 -0
- data/src/core/ext/upb-generated/envoy/api/v2/cluster.upb.h +1411 -0
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c +29 -8
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h +60 -0
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c +1 -0
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c +1 -0
- data/src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c +5 -3
- data/src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h +6 -2
- data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c +48 -5
- data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h +154 -4
- data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c +19 -15
- data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h +46 -32
- data/src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c +26 -4
- data/src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h +70 -0
- data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c +42 -25
- data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h +83 -25
- data/src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c +1 -0
- data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c +43 -7
- data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h +115 -0
- data/src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c +1 -0
- data/src/core/ext/upb-generated/envoy/api/v2/eds.upb.c +7 -68
- data/src/core/ext/upb-generated/envoy/api/v2/eds.upb.h +14 -201
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint.upb.c +91 -0
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint.upb.h +240 -0
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c +1 -71
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h +3 -228
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint_components.upb.c +88 -0
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint_components.upb.h +258 -0
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c +1 -0
- data/src/core/ext/upb-generated/envoy/api/v2/lds.upb.c +30 -0
- data/src/core/ext/upb-generated/envoy/api/v2/lds.upb.h +53 -0
- data/src/core/ext/upb-generated/envoy/api/v2/listener.upb.c +104 -0
- data/src/core/ext/upb-generated/envoy/api/v2/listener.upb.h +383 -0
- data/src/core/ext/upb-generated/envoy/api/v2/listener/listener.upb.c +17 -0
- data/src/core/ext/upb-generated/envoy/api/v2/listener/listener.upb.h +33 -0
- data/src/core/ext/upb-generated/envoy/api/v2/listener/listener_components.upb.c +144 -0
- data/src/core/ext/upb-generated/envoy/api/v2/listener/listener_components.upb.h +527 -0
- data/src/core/ext/upb-generated/envoy/api/v2/listener/udp_listener_config.upb.c +42 -0
- data/src/core/ext/upb-generated/envoy/api/v2/listener/udp_listener_config.upb.h +112 -0
- data/src/core/ext/upb-generated/envoy/api/v2/rds.upb.c +29 -0
- data/src/core/ext/upb-generated/envoy/api/v2/rds.upb.h +53 -0
- data/src/core/ext/upb-generated/envoy/api/v2/route.upb.c +62 -0
- data/src/core/ext/upb-generated/envoy/api/v2/route.upb.h +199 -0
- data/src/core/ext/upb-generated/envoy/api/v2/route/route.upb.c +17 -0
- data/src/core/ext/upb-generated/envoy/api/v2/route/route.upb.h +33 -0
- data/src/core/ext/upb-generated/envoy/api/v2/route/route_components.upb.c +793 -0
- data/src/core/ext/upb-generated/envoy/api/v2/route/route_components.upb.h +2936 -0
- data/src/core/ext/upb-generated/envoy/api/v2/scoped_route.upb.c +58 -0
- data/src/core/ext/upb-generated/envoy/api/v2/scoped_route.upb.h +134 -0
- data/src/core/ext/upb-generated/envoy/api/v2/srds.upb.c +27 -0
- data/src/core/ext/upb-generated/envoy/api/v2/srds.upb.h +53 -0
- data/src/core/ext/upb-generated/envoy/config/filter/accesslog/v2/accesslog.upb.c +227 -0
- data/src/core/ext/upb-generated/envoy/config/filter/accesslog/v2/accesslog.upb.h +725 -0
- data/src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.upb.c +296 -0
- data/src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.upb.h +1072 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v2/api_listener.upb.c +32 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v2/api_listener.upb.h +65 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/regex.upb.c +47 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/regex.upb.h +108 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/string.upb.c +52 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/string.upb.h +133 -0
- data/src/core/ext/upb-generated/envoy/type/metadata/v2/metadata.upb.c +87 -0
- data/src/core/ext/upb-generated/envoy/type/metadata/v2/metadata.upb.h +258 -0
- data/src/core/ext/upb-generated/envoy/type/range.upb.c +11 -0
- data/src/core/ext/upb-generated/envoy/type/range.upb.h +27 -0
- data/src/core/ext/upb-generated/envoy/type/semantic_version.upb.c +28 -0
- data/src/core/ext/upb-generated/envoy/type/semantic_version.upb.h +62 -0
- data/src/core/ext/upb-generated/envoy/type/tracing/v2/custom_tag.upb.c +88 -0
- data/src/core/ext/upb-generated/envoy/type/tracing/v2/custom_tag.upb.h +249 -0
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +30 -27
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +64 -52
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +48 -0
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +104 -0
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +17 -0
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +30 -0
- data/src/core/ext/upb-generated/validate/validate.upb.c +38 -34
- data/src/core/ext/upb-generated/validate/validate.upb.h +129 -99
- data/src/core/lib/channel/channel_trace.cc +32 -41
- data/src/core/lib/channel/channel_trace.h +3 -3
- data/src/core/lib/channel/channelz.cc +158 -248
- data/src/core/lib/channel/channelz.h +12 -15
- data/src/core/lib/channel/channelz_registry.cc +47 -74
- data/src/core/lib/channel/channelz_registry.h +4 -4
- data/src/core/lib/gpr/sync_abseil.cc +114 -0
- data/src/core/lib/gpr/sync_posix.cc +8 -5
- data/src/core/lib/gpr/sync_windows.cc +4 -2
- data/src/core/lib/gprpp/host_port.cc +1 -1
- data/src/core/lib/gprpp/inlined_vector.h +1 -210
- data/src/core/lib/gprpp/memory.h +2 -6
- data/src/core/lib/gprpp/optional.h +0 -41
- data/src/core/lib/gprpp/string_view.h +5 -114
- data/src/core/lib/iomgr/buffer_list.cc +36 -35
- data/src/core/lib/iomgr/error.h +4 -4
- data/src/core/lib/iomgr/ev_epollex_linux.cc +12 -4
- data/src/core/lib/iomgr/load_file.cc +1 -0
- data/src/core/lib/iomgr/tcp_client_posix.cc +17 -17
- data/src/core/lib/iomgr/tcp_client_posix.h +6 -6
- data/src/core/lib/iomgr/tcp_posix.cc +2 -1
- data/src/core/lib/iomgr/work_serializer.cc +155 -0
- data/src/core/lib/iomgr/work_serializer.h +65 -0
- data/src/core/lib/json/json.h +209 -79
- data/src/core/lib/json/json_reader.cc +469 -455
- data/src/core/lib/json/json_writer.cc +173 -169
- data/src/core/lib/security/credentials/alts/check_gcp_environment.cc +1 -1
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +10 -8
- data/src/core/lib/security/credentials/jwt/json_token.cc +26 -56
- data/src/core/lib/security/credentials/jwt/json_token.h +2 -1
- data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +8 -18
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +149 -159
- data/src/core/lib/security/credentials/jwt/jwt_verifier.h +2 -3
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +37 -34
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +1 -1
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +2 -1
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +5 -7
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +3 -15
- data/src/core/lib/security/security_connector/ssl_utils.cc +3 -1
- data/src/core/lib/security/security_connector/ssl_utils.h +0 -1
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +24 -1
- data/src/core/lib/security/security_connector/tls/tls_security_connector.h +5 -1
- data/src/core/lib/security/transport/security_handshaker.cc +2 -2
- data/src/core/lib/security/util/json_util.cc +22 -15
- data/src/core/lib/security/util/json_util.h +2 -2
- data/src/core/lib/surface/version.cc +1 -1
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +1 -1
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +1 -1
- data/src/core/tsi/grpc_shadow_boringssl.h +1333 -1319
- data/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +1 -1
- data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +1 -1
- data/src/core/tsi/ssl_transport_security.cc +2 -1
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/third_party/abseil-cpp/absl/base/attributes.h +1 -1
- data/third_party/abseil-cpp/absl/base/config.h +10 -4
- data/third_party/abseil-cpp/absl/base/internal/atomic_hook.h +30 -9
- data/third_party/abseil-cpp/absl/base/internal/errno_saver.h +43 -0
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +7 -5
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +2 -1
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +2 -2
- data/third_party/abseil-cpp/absl/base/internal/spinlock_linux.inc +2 -3
- data/third_party/abseil-cpp/absl/base/internal/spinlock_posix.inc +3 -3
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +37 -0
- data/third_party/abseil-cpp/absl/base/options.h +2 -10
- data/third_party/abseil-cpp/absl/strings/charconv.cc +0 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +388 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +432 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +245 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +209 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +326 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +51 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +415 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +493 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.h +23 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/output.cc +72 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/output.h +104 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +334 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +333 -0
- data/third_party/abseil-cpp/absl/strings/str_format.h +537 -0
- data/third_party/abseil-cpp/absl/strings/string_view.h +19 -11
- data/{src/boringssl → third_party/boringssl-with-bazel}/err_data.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_bitstr.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_bool.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_d2i_fp.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_dup.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_enum.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_gentm.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_i2d_fp.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_int.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_mbstr.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_object.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_octet.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_print.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_strnid.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_time.c +3 -4
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_type.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_utctm.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_utf8.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/asn1_lib.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/asn1_locl.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/asn1_par.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/asn_pack.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/f_enum.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/f_int.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/f_string.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/tasn_dec.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/tasn_enc.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/tasn_fre.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/tasn_new.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/tasn_typ.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/tasn_utl.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/time_support.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/base64/base64.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/bio.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/bio_mem.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/connect.c +3 -4
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/fd.c +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/file.c +5 -6
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/hexdump.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/pair.c +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/printf.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/socket.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/socket_helper.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bn_extra/bn_asn1.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bn_extra/convert.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/buf/buf.c +10 -69
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bytestring/asn1_compat.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bytestring/ber.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bytestring/cbb.c +41 -2
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bytestring/cbs.c +60 -3
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bytestring/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bytestring/unicode.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/chacha/chacha.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/chacha/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/cipher_extra.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/derive_key.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_aesccm.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_aesctrhmac.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_aesgcmsiv.c +8 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_chacha20poly1305.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_null.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_rc2.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_rc4.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_tls.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/tls_cbc.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cmac/cmac.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/conf/conf.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/conf/conf_def.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/conf/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cpu-aarch64-fuchsia.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cpu-aarch64-linux.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cpu-arm-linux.c +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cpu-arm-linux.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cpu-arm.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cpu-intel.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cpu-ppc64le.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/crypto.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/curve25519/spake25519.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/dh/check.c +3 -3
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/dh/dh.c +1 -2
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/dh/dh_asn1.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/dh/params.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/digest_extra/digest_extra.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/dsa/dsa.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/dsa/dsa_asn1.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/ec_extra/ec_asn1.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/ec_extra/ec_derive.c +2 -3
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/ecdh_extra/ecdh_extra.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/ecdsa_extra/ecdsa_asn1.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/engine/engine.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/err/err.c +6 -6
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/err/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/digestsign.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/evp.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/evp_asn1.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/evp_ctx.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_dsa_asn1.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_ec.c +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_ec_asn1.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_ed25519.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_ed25519_asn1.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_rsa.c +14 -2
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_rsa_asn1.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_x25519.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_x25519_asn1.c +1 -2
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/pbkdf.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/print.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/scrypt.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/sign.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/ex_data.c +0 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/aes.c +108 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/aes_nohw.c +1282 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/aes/internal.h +5 -7
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/aes/key_wrap.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/aes/mode_wrappers.c +0 -2
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bcm.c +2 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/add.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/asm/x86_64-gcc.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/bn.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/bytes.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/cmp.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/ctx.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/div.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/div_extra.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/exponentiation.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/gcd.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/gcd_extra.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/generic.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/jacobi.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/montgomery.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/montgomery_inv.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/mul.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/prime.c +11 -12
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/random.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/rsaz_exp.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/rsaz_exp.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/shift.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/sqrt.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/cipher/aead.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/cipher/cipher.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/cipher/e_aes.c +3 -5
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/cipher/e_des.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/cipher/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/delocate.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/des/des.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/des/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/digest/digest.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/digest/digests.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/digest/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/digest/md32_common.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/ec.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/ec_key.c +1 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/ec_montgomery.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/felem.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/oct.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/p224-64.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/p256-x86_64-table.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/p256-x86_64.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/p256-x86_64.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/scalar.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/simple.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/simple_mul.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/util.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/wnaf.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ecdh/ecdh.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ecdsa/ecdsa.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/fips_shared_support.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/hmac/hmac.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/is_fips.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/md4/md4.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/md5/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/md5/md5.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/modes/cbc.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/modes/cfb.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/modes/ctr.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/modes/gcm.c +45 -193
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/gcm_nohw.c +304 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/modes/internal.h +8 -18
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/modes/ofb.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/modes/polyval.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rand/ctrdrbg.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rand/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rand/rand.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rand/urandom.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rsa/blinding.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rsa/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rsa/padding.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rsa/rsa.c +7 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rsa/rsa_impl.c +60 -51
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/self_check/self_check.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/sha/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/sha/sha1-altivec.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/sha/sha1.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/sha/sha256.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/sha/sha512.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/tls/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/tls/kdf.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/hkdf/hkdf.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/hrss/hrss.c +210 -311
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/hrss/internal.h +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/internal.h +21 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/lhash/lhash.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/mem.c +70 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/obj/obj.c +16 -21
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/obj/obj_dat.h +27 -6
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/obj/obj_xref.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_all.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_info.c +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_lib.c +7 -7
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_oth.c +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_pk8.c +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_pkey.c +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_x509.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_xaux.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pkcs7/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pkcs7/pkcs7.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pkcs7/pkcs7_x509.c +1 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pkcs8/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pkcs8/p5_pbev2.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pkcs8/pkcs8.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pkcs8/pkcs8_x509.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/poly1305/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/poly1305/poly1305.c +2 -2
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/poly1305/poly1305_arm.c +21 -20
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/poly1305/poly1305_vec.c +34 -17
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pool/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pool/pool.c +1 -2
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rand_extra/deterministic.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rand_extra/forkunsafe.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rand_extra/fuchsia.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rand_extra/rand_extra.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rand_extra/windows.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rc4/rc4.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/refcount_c11.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/refcount_lock.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rsa_extra/rsa_asn1.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rsa_extra/rsa_print.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/siphash/siphash.c +3 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/stack/stack.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/thread.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/thread_none.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/thread_pthread.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/thread_win.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/a_digest.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/a_sign.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/a_strex.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/a_verify.c +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/algorithm.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/asn1_gen.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/by_dir.c +1 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/by_file.c +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/charmap.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/i2d_pr.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/rsa_pss.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/t_crl.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/t_req.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/t_x509.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/t_x509a.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/vpm_int.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_att.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_cmp.c +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_d2.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_def.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_ext.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_lu.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_obj.c +1 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_r2x.c +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_req.c +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_set.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_trs.c +1 -2
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_txt.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_v3.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_vfy.c +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_vpm.c +3 -4
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509cset.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509name.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509rset.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509spki.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_algor.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_all.c +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_attrib.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_crl.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_exten.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_info.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_name.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_pkey.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_pubkey.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_req.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_sig.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_spki.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_val.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_x509.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_x509a.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/ext_dat.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/pcy_cache.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/pcy_data.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/pcy_int.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/pcy_lib.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/pcy_map.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/pcy_node.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/pcy_tree.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_akey.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_akeya.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_alt.c +3 -3
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_bcons.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_bitst.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_conf.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_cpols.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_crld.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_enum.c +2 -2
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_extku.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_genn.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_ia5.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_info.c +4 -5
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_int.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_lib.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_ncons.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_ocsp.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_pci.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_pcia.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_pcons.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_pku.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_pmaps.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_prn.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_purp.c +2 -3
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_skey.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_sxnet.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_utl.c +11 -12
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/aead.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/aes.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/arm_arch.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/asn1.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/asn1_mac.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/asn1t.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/base.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/base64.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/bio.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/blowfish.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/bn.h +32 -20
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/buf.h +9 -9
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/buffer.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/bytestring.h +34 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/cast.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/chacha.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/cipher.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/cmac.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/conf.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/cpu.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/crypto.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/curve25519.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/des.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/dh.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/digest.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/dsa.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/dtls1.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/e_os2.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ec.h +11 -4
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ec_key.h +4 -2
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ecdh.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ecdsa.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/engine.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/err.h +11 -9
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/evp.h +20 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ex_data.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/hkdf.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/hmac.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/hrss.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/is_boringssl.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/lhash.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/md4.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/md5.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/mem.h +17 -2
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/nid.h +9 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/obj.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/obj_mac.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/objects.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/opensslconf.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/opensslv.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ossl_typ.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/pem.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/pkcs12.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/pkcs7.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/pkcs8.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/poly1305.h +5 -7
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/pool.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/rand.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/rc4.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ripemd.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/rsa.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/safestack.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/sha.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/siphash.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/span.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/srtp.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ssl.h +10 -20
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ssl3.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/stack.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/thread.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/tls1.h +0 -3
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/type_check.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/x509.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/x509_vfy.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/x509v3.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/bio_ssl.cc +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/d1_both.cc +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/d1_lib.cc +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/d1_pkt.cc +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/d1_srtp.cc +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/dtls_method.cc +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/dtls_record.cc +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/handoff.cc +126 -29
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/handshake.cc +5 -4
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/handshake_client.cc +24 -13
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/handshake_server.cc +1 -5
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/internal.h +32 -26
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/s3_both.cc +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/s3_lib.cc +2 -3
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/s3_pkt.cc +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_aead_ctx.cc +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_asn1.cc +1 -2
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_buffer.cc +34 -15
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_cert.cc +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_cipher.cc +0 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_file.cc +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_key_share.cc +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_lib.cc +13 -14
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_privkey.cc +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_session.cc +2 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_stat.cc +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_transcript.cc +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_versions.cc +1 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_x509.cc +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/t1_enc.cc +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/t1_lib.cc +11 -171
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/tls13_both.cc +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/tls13_client.cc +3 -4
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/tls13_enc.cc +5 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/tls13_server.cc +78 -101
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/tls_method.cc +1 -1
- data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/tls_record.cc +7 -2
- data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/curve25519.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/curve25519_32.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/curve25519_64.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/curve25519_tables.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/internal.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/p256.c +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/p256_32.h +0 -0
- data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/p256_64.h +0 -0
- metadata +562 -491
- data/src/core/lib/iomgr/logical_thread.cc +0 -103
- data/src/core/lib/iomgr/logical_thread.h +0 -52
- data/src/core/lib/json/json.cc +0 -94
- data/third_party/boringssl/crypto/fipsmodule/aes/aes.c +0 -860
@@ -19,6 +19,8 @@
|
|
19
19
|
|
20
20
|
#include <grpc/support/port_platform.h>
|
21
21
|
|
22
|
+
#include <memory>
|
23
|
+
#include <string>
|
22
24
|
#include <vector>
|
23
25
|
|
24
26
|
#include <grpc/impl/codegen/slice.h>
|
@@ -33,33 +35,22 @@ namespace grpc_core {
|
|
33
35
|
|
34
36
|
class XdsBootstrap {
|
35
37
|
public:
|
36
|
-
struct MetadataValue {
|
37
|
-
enum class Type { MD_NULL, DOUBLE, STRING, BOOL, STRUCT, LIST };
|
38
|
-
Type type = Type::MD_NULL;
|
39
|
-
// TODO(roth): Once we can use C++17, these can be in a std::variant.
|
40
|
-
double double_value;
|
41
|
-
const char* string_value;
|
42
|
-
bool bool_value;
|
43
|
-
std::map<const char*, MetadataValue, StringLess> struct_value;
|
44
|
-
std::vector<MetadataValue> list_value;
|
45
|
-
};
|
46
|
-
|
47
38
|
struct Node {
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
39
|
+
std::string id;
|
40
|
+
std::string cluster;
|
41
|
+
std::string locality_region;
|
42
|
+
std::string locality_zone;
|
43
|
+
std::string locality_subzone;
|
44
|
+
Json metadata;
|
54
45
|
};
|
55
46
|
|
56
47
|
struct ChannelCreds {
|
57
|
-
|
58
|
-
|
48
|
+
std::string type;
|
49
|
+
Json config;
|
59
50
|
};
|
60
51
|
|
61
52
|
struct XdsServer {
|
62
|
-
|
53
|
+
std::string server_uri;
|
63
54
|
InlinedVector<ChannelCreds, 1> channel_creds;
|
64
55
|
};
|
65
56
|
|
@@ -68,8 +59,7 @@ class XdsBootstrap {
|
|
68
59
|
static std::unique_ptr<XdsBootstrap> ReadFromFile(grpc_error** error);
|
69
60
|
|
70
61
|
// Do not instantiate directly -- use ReadFromFile() above instead.
|
71
|
-
XdsBootstrap(
|
72
|
-
~XdsBootstrap();
|
62
|
+
XdsBootstrap(Json json, grpc_error** error);
|
73
63
|
|
74
64
|
// TODO(roth): We currently support only one server. Fix this when we
|
75
65
|
// add support for fallback for the xds channel.
|
@@ -77,23 +67,12 @@ class XdsBootstrap {
|
|
77
67
|
const Node* node() const { return node_.get(); }
|
78
68
|
|
79
69
|
private:
|
80
|
-
grpc_error* ParseXdsServerList(
|
81
|
-
grpc_error* ParseXdsServer(
|
82
|
-
grpc_error* ParseChannelCredsArray(
|
83
|
-
grpc_error* ParseChannelCreds(
|
84
|
-
grpc_error* ParseNode(
|
85
|
-
grpc_error* ParseLocality(
|
86
|
-
|
87
|
-
InlinedVector<grpc_error*, 1> ParseMetadataStruct(
|
88
|
-
grpc_json* json,
|
89
|
-
std::map<const char*, MetadataValue, StringLess>* result);
|
90
|
-
InlinedVector<grpc_error*, 1> ParseMetadataList(
|
91
|
-
grpc_json* json, std::vector<MetadataValue>* result);
|
92
|
-
grpc_error* ParseMetadataValue(grpc_json* json, size_t idx,
|
93
|
-
MetadataValue* result);
|
94
|
-
|
95
|
-
grpc_slice contents_;
|
96
|
-
grpc_json* tree_ = nullptr;
|
70
|
+
grpc_error* ParseXdsServerList(Json* json);
|
71
|
+
grpc_error* ParseXdsServer(Json* json, size_t idx);
|
72
|
+
grpc_error* ParseChannelCredsArray(Json* json, XdsServer* server);
|
73
|
+
grpc_error* ParseChannelCreds(Json* json, size_t idx, XdsServer* server);
|
74
|
+
grpc_error* ParseNode(Json* json);
|
75
|
+
grpc_error* ParseLocality(Json* json);
|
97
76
|
|
98
77
|
InlinedVector<XdsServer, 1> servers_;
|
99
78
|
std::unique_ptr<Node> node_;
|
@@ -24,6 +24,7 @@
|
|
24
24
|
#include <grpc/impl/codegen/grpc_types.h>
|
25
25
|
|
26
26
|
#include "src/core/ext/filters/client_channel/xds/xds_bootstrap.h"
|
27
|
+
#include "src/core/lib/iomgr/error.h"
|
27
28
|
|
28
29
|
namespace grpc_core {
|
29
30
|
|
@@ -36,7 +37,8 @@ namespace grpc_core {
|
|
36
37
|
grpc_channel_args* ModifyXdsChannelArgs(grpc_channel_args* args);
|
37
38
|
|
38
39
|
grpc_channel* CreateXdsChannel(const XdsBootstrap& bootstrap,
|
39
|
-
const grpc_channel_args& args
|
40
|
+
const grpc_channel_args& args,
|
41
|
+
grpc_error** error);
|
40
42
|
|
41
43
|
} // namespace grpc_core
|
42
44
|
|
@@ -64,36 +64,39 @@ grpc_channel_args* ModifyXdsChannelArgs(grpc_channel_args* args) {
|
|
64
64
|
}
|
65
65
|
|
66
66
|
grpc_channel* CreateXdsChannel(const XdsBootstrap& bootstrap,
|
67
|
-
const grpc_channel_args& args
|
67
|
+
const grpc_channel_args& args,
|
68
|
+
grpc_error** error) {
|
68
69
|
grpc_channel_credentials* creds = nullptr;
|
69
70
|
RefCountedPtr<grpc_channel_credentials> creds_to_unref;
|
70
71
|
if (!bootstrap.server().channel_creds.empty()) {
|
71
72
|
for (size_t i = 0; i < bootstrap.server().channel_creds.size(); ++i) {
|
72
|
-
if (
|
73
|
-
0) {
|
73
|
+
if (bootstrap.server().channel_creds[i].type == "google_default") {
|
74
74
|
creds = grpc_google_default_credentials_create();
|
75
75
|
break;
|
76
|
-
} else if (
|
77
|
-
0) {
|
76
|
+
} else if (bootstrap.server().channel_creds[i].type == "fake") {
|
78
77
|
creds = grpc_fake_transport_security_credentials_create();
|
79
78
|
break;
|
80
79
|
}
|
81
80
|
}
|
82
|
-
if (creds == nullptr)
|
81
|
+
if (creds == nullptr) {
|
82
|
+
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
83
|
+
"no supported credential types found");
|
84
|
+
return nullptr;
|
85
|
+
}
|
83
86
|
creds_to_unref.reset(creds);
|
84
87
|
} else {
|
85
88
|
creds = grpc_channel_credentials_find_in_args(&args);
|
86
89
|
if (creds == nullptr) {
|
87
90
|
// Built with security but parent channel is insecure.
|
88
|
-
return grpc_insecure_channel_create(bootstrap.server().server_uri,
|
89
|
-
nullptr);
|
91
|
+
return grpc_insecure_channel_create(bootstrap.server().server_uri.c_str(),
|
92
|
+
&args, nullptr);
|
90
93
|
}
|
91
94
|
}
|
92
95
|
const char* arg_to_remove = GRPC_ARG_CHANNEL_CREDENTIALS;
|
93
96
|
grpc_channel_args* new_args =
|
94
97
|
grpc_channel_args_copy_and_remove(&args, &arg_to_remove, 1);
|
95
98
|
grpc_channel* channel = grpc_secure_channel_create(
|
96
|
-
creds, bootstrap.server().server_uri, new_args, nullptr);
|
99
|
+
creds, bootstrap.server().server_uri.c_str(), new_args, nullptr);
|
97
100
|
grpc_channel_args_destroy(new_args);
|
98
101
|
return channel;
|
99
102
|
}
|
@@ -125,29 +125,123 @@ class XdsClient::ChannelState::AdsCallState
|
|
125
125
|
XdsClient* xds_client() const { return chand()->xds_client(); }
|
126
126
|
bool seen_response() const { return seen_response_; }
|
127
127
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
void SendMessageLocked(const std::string& type_url,
|
133
|
-
const std::string& nonce_for_unsupported_type,
|
134
|
-
grpc_error* error_for_unsupported_type,
|
135
|
-
bool is_first_message);
|
128
|
+
void Subscribe(const std::string& type_url, const std::string& name);
|
129
|
+
void Unsubscribe(const std::string& type_url, const std::string& name);
|
130
|
+
|
131
|
+
bool HasSubscribedResources() const;
|
136
132
|
|
137
133
|
private:
|
138
|
-
|
139
|
-
|
140
|
-
|
134
|
+
class ResourceState : public InternallyRefCounted<ResourceState> {
|
135
|
+
public:
|
136
|
+
ResourceState(const std::string& type_url, const std::string& name)
|
137
|
+
: type_url_(type_url), name_(name) {
|
138
|
+
GRPC_CLOSURE_INIT(&timer_callback_, OnTimer, this,
|
139
|
+
grpc_schedule_on_exec_ctx);
|
140
|
+
}
|
141
|
+
|
142
|
+
void Orphan() override {
|
143
|
+
Finish();
|
144
|
+
Unref();
|
145
|
+
}
|
146
|
+
|
147
|
+
void Start(RefCountedPtr<AdsCallState> ads_calld) {
|
148
|
+
if (sent_) return;
|
149
|
+
sent_ = true;
|
150
|
+
ads_calld_ = std::move(ads_calld);
|
151
|
+
Ref().release();
|
152
|
+
timer_pending_ = true;
|
153
|
+
grpc_timer_init(
|
154
|
+
&timer_,
|
155
|
+
ExecCtx::Get()->Now() + ads_calld_->xds_client()->request_timeout_,
|
156
|
+
&timer_callback_);
|
157
|
+
}
|
158
|
+
|
159
|
+
void Finish() {
|
160
|
+
if (timer_pending_) {
|
161
|
+
grpc_timer_cancel(&timer_);
|
162
|
+
timer_pending_ = false;
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
private:
|
167
|
+
static void OnTimer(void* arg, grpc_error* error) {
|
168
|
+
ResourceState* self = static_cast<ResourceState*>(arg);
|
169
|
+
self->ads_calld_->xds_client()->combiner_->Run(
|
170
|
+
GRPC_CLOSURE_INIT(&self->timer_callback_, OnTimerLocked, self,
|
171
|
+
nullptr),
|
172
|
+
GRPC_ERROR_REF(error));
|
173
|
+
}
|
174
|
+
|
175
|
+
static void OnTimerLocked(void* arg, grpc_error* error) {
|
176
|
+
ResourceState* self = static_cast<ResourceState*>(arg);
|
177
|
+
if (error == GRPC_ERROR_NONE && self->timer_pending_) {
|
178
|
+
self->timer_pending_ = false;
|
179
|
+
char* msg;
|
180
|
+
gpr_asprintf(
|
181
|
+
&msg,
|
182
|
+
"timeout obtaining resource {type=%s name=%s} from xds server",
|
183
|
+
self->type_url_.c_str(), self->name_.c_str());
|
184
|
+
grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
|
185
|
+
gpr_free(msg);
|
186
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
187
|
+
gpr_log(GPR_INFO, "[xds_client %p] %s",
|
188
|
+
self->ads_calld_->xds_client(), grpc_error_string(error));
|
189
|
+
}
|
190
|
+
if (self->type_url_ == XdsApi::kLdsTypeUrl ||
|
191
|
+
self->type_url_ == XdsApi::kRdsTypeUrl) {
|
192
|
+
self->ads_calld_->xds_client()->service_config_watcher_->OnError(
|
193
|
+
error);
|
194
|
+
} else if (self->type_url_ == XdsApi::kCdsTypeUrl) {
|
195
|
+
ClusterState& state =
|
196
|
+
self->ads_calld_->xds_client()->cluster_map_[self->name_];
|
197
|
+
for (const auto& p : state.watchers) {
|
198
|
+
p.first->OnError(GRPC_ERROR_REF(error));
|
199
|
+
}
|
200
|
+
GRPC_ERROR_UNREF(error);
|
201
|
+
} else if (self->type_url_ == XdsApi::kEdsTypeUrl) {
|
202
|
+
EndpointState& state =
|
203
|
+
self->ads_calld_->xds_client()->endpoint_map_[self->name_];
|
204
|
+
for (const auto& p : state.watchers) {
|
205
|
+
p.first->OnError(GRPC_ERROR_REF(error));
|
206
|
+
}
|
207
|
+
GRPC_ERROR_UNREF(error);
|
208
|
+
} else {
|
209
|
+
GPR_UNREACHABLE_CODE(return );
|
210
|
+
}
|
211
|
+
}
|
212
|
+
self->ads_calld_.reset();
|
213
|
+
self->Unref();
|
214
|
+
}
|
141
215
|
|
142
|
-
|
143
|
-
|
144
|
-
: nonce(std::move(nonce)), error(error) {}
|
216
|
+
const std::string type_url_;
|
217
|
+
const std::string name_;
|
145
218
|
|
146
|
-
|
219
|
+
RefCountedPtr<AdsCallState> ads_calld_;
|
220
|
+
bool sent_ = false;
|
221
|
+
bool timer_pending_ = false;
|
222
|
+
grpc_timer timer_;
|
223
|
+
grpc_closure timer_callback_;
|
147
224
|
};
|
148
225
|
|
149
|
-
|
150
|
-
|
226
|
+
struct ResourceTypeState {
|
227
|
+
~ResourceTypeState() { GRPC_ERROR_UNREF(error); }
|
228
|
+
|
229
|
+
// Version, nonce, and error for this resource type.
|
230
|
+
std::string version;
|
231
|
+
std::string nonce;
|
232
|
+
grpc_error* error = GRPC_ERROR_NONE;
|
233
|
+
|
234
|
+
// Subscribed resources of this type.
|
235
|
+
std::map<std::string /* name */, OrphanablePtr<ResourceState>>
|
236
|
+
subscribed_resources;
|
237
|
+
};
|
238
|
+
|
239
|
+
void SendMessageLocked(const std::string& type_url);
|
240
|
+
|
241
|
+
void AcceptLdsUpdate(XdsApi::LdsUpdate lds_update);
|
242
|
+
void AcceptRdsUpdate(XdsApi::RdsUpdate rds_update);
|
243
|
+
void AcceptCdsUpdate(XdsApi::CdsUpdateMap cds_update_map);
|
244
|
+
void AcceptEdsUpdate(XdsApi::EdsUpdateMap eds_update_map);
|
151
245
|
|
152
246
|
static void OnRequestSent(void* arg, grpc_error* error);
|
153
247
|
static void OnRequestSentLocked(void* arg, grpc_error* error);
|
@@ -158,8 +252,13 @@ class XdsClient::ChannelState::AdsCallState
|
|
158
252
|
|
159
253
|
bool IsCurrentCallOnChannel() const;
|
160
254
|
|
255
|
+
std::set<StringView> ClusterNamesForRequest();
|
256
|
+
std::set<StringView> EdsServiceNamesForRequest();
|
257
|
+
|
161
258
|
// The owning RetryableCall<>.
|
162
259
|
RefCountedPtr<RetryableCall<AdsCallState>> parent_;
|
260
|
+
|
261
|
+
bool sent_initial_message_ = false;
|
163
262
|
bool seen_response_ = false;
|
164
263
|
|
165
264
|
// Always non-NULL.
|
@@ -182,13 +281,11 @@ class XdsClient::ChannelState::AdsCallState
|
|
182
281
|
grpc_slice status_details_;
|
183
282
|
grpc_closure on_status_received_;
|
184
283
|
|
185
|
-
//
|
186
|
-
|
187
|
-
VersionState eds_version_;
|
284
|
+
// Resource types for which requests need to be sent.
|
285
|
+
std::set<std::string /*type_url*/> buffered_requests_;
|
188
286
|
|
189
|
-
//
|
190
|
-
std::map<std::string /*type_url*/,
|
191
|
-
buffered_request_map_;
|
287
|
+
// State for each resource type.
|
288
|
+
std::map<std::string /*type_url*/, ResourceTypeState> state_map_;
|
192
289
|
};
|
193
290
|
|
194
291
|
// Contains an LRS call to the xds server.
|
@@ -341,9 +438,14 @@ grpc_channel_args* BuildXdsChannelArgs(const grpc_channel_args& args) {
|
|
341
438
|
// Don't want to pass down channelz node from parent; the balancer
|
342
439
|
// channel will get its own.
|
343
440
|
GRPC_ARG_CHANNELZ_CHANNEL_NODE,
|
441
|
+
// Keepalive interval. We are explicitly setting our own value below.
|
442
|
+
GRPC_ARG_KEEPALIVE_TIME_MS,
|
344
443
|
};
|
345
444
|
// Channel args to add.
|
346
|
-
InlinedVector<grpc_arg,
|
445
|
+
InlinedVector<grpc_arg, 3> args_to_add;
|
446
|
+
// Keepalive interval.
|
447
|
+
args_to_add.emplace_back(grpc_channel_arg_integer_create(
|
448
|
+
const_cast<char*>(GRPC_ARG_KEEPALIVE_TIME_MS), 5000));
|
347
449
|
// A channel arg indicating that the target is an xds server.
|
348
450
|
// TODO(roth): Once we figure out our fallback and credentials story, decide
|
349
451
|
// whether this is actually needed. Note that it's currently used by the
|
@@ -371,12 +473,10 @@ grpc_channel_args* BuildXdsChannelArgs(const grpc_channel_args& args) {
|
|
371
473
|
} // namespace
|
372
474
|
|
373
475
|
XdsClient::ChannelState::ChannelState(RefCountedPtr<XdsClient> xds_client,
|
374
|
-
|
476
|
+
grpc_channel* channel)
|
375
477
|
: InternallyRefCounted<ChannelState>(&grpc_xds_client_trace),
|
376
|
-
xds_client_(std::move(xds_client))
|
377
|
-
|
378
|
-
channel_ = CreateXdsChannel(*xds_client_->bootstrap_, *new_args);
|
379
|
-
grpc_channel_args_destroy(new_args);
|
478
|
+
xds_client_(std::move(xds_client)),
|
479
|
+
channel_(channel) {
|
380
480
|
GPR_ASSERT(channel_ != nullptr);
|
381
481
|
StartConnectivityWatchLocked();
|
382
482
|
}
|
@@ -436,31 +536,30 @@ void XdsClient::ChannelState::CancelConnectivityWatchLocked() {
|
|
436
536
|
grpc_client_channel_stop_connectivity_watch(client_channel_elem, watcher_);
|
437
537
|
}
|
438
538
|
|
439
|
-
void XdsClient::ChannelState::
|
440
|
-
|
539
|
+
void XdsClient::ChannelState::Subscribe(const std::string& type_url,
|
540
|
+
const std::string& name) {
|
441
541
|
if (ads_calld_ == nullptr) {
|
442
542
|
// Start the ADS call if this is the first request.
|
443
543
|
ads_calld_.reset(new RetryableCall<AdsCallState>(
|
444
544
|
Ref(DEBUG_LOCATION, "ChannelState+ads")));
|
445
|
-
// Note: AdsCallState's ctor will automatically
|
446
|
-
// we can
|
545
|
+
// Note: AdsCallState's ctor will automatically subscribe to all
|
546
|
+
// resources that the XdsClient already has watchers for, so we can
|
547
|
+
// return here.
|
447
548
|
return;
|
448
549
|
}
|
449
550
|
// If the ADS call is in backoff state, we don't need to do anything now
|
450
551
|
// because when the call is restarted it will resend all necessary requests.
|
451
552
|
if (ads_calld() == nullptr) return;
|
452
|
-
//
|
453
|
-
ads_calld()->
|
553
|
+
// Subscribe to this resource if the ADS call is active.
|
554
|
+
ads_calld()->Subscribe(type_url, name);
|
454
555
|
}
|
455
556
|
|
456
|
-
void XdsClient::ChannelState::
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
if (!
|
557
|
+
void XdsClient::ChannelState::Unsubscribe(const std::string& type_url,
|
558
|
+
const std::string& name) {
|
559
|
+
if (ads_calld_ != nullptr) {
|
560
|
+
ads_calld_->calld()->Unsubscribe(type_url, name);
|
561
|
+
if (!ads_calld_->calld()->HasSubscribedResources()) ads_calld_.reset();
|
461
562
|
}
|
462
|
-
if (!xds_client()->endpoint_map_.empty()) return;
|
463
|
-
ads_calld_.reset();
|
464
563
|
}
|
465
564
|
|
466
565
|
//
|
@@ -611,13 +710,14 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
|
|
611
710
|
// Op: send request message.
|
612
711
|
GRPC_CLOSURE_INIT(&on_request_sent_, OnRequestSent, this,
|
613
712
|
grpc_schedule_on_exec_ctx);
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
713
|
+
if (xds_client()->service_config_watcher_ != nullptr) {
|
714
|
+
Subscribe(XdsApi::kLdsTypeUrl, xds_client()->server_name_);
|
715
|
+
}
|
716
|
+
for (const auto& p : xds_client()->cluster_map_) {
|
717
|
+
Subscribe(XdsApi::kCdsTypeUrl, std::string(p.first));
|
618
718
|
}
|
619
|
-
|
620
|
-
|
719
|
+
for (const auto& p : xds_client()->endpoint_map_) {
|
720
|
+
Subscribe(XdsApi::kEdsTypeUrl, std::string(p.first));
|
621
721
|
}
|
622
722
|
// Op: recv initial metadata.
|
623
723
|
op = ops;
|
@@ -675,40 +775,46 @@ void XdsClient::ChannelState::AdsCallState::Orphan() {
|
|
675
775
|
// we are here because xds_client has to orphan a failed call, then the
|
676
776
|
// following cancellation will be a no-op.
|
677
777
|
grpc_call_cancel(call_, nullptr);
|
778
|
+
state_map_.clear();
|
678
779
|
// Note that the initial ref is hold by on_status_received_. So the
|
679
780
|
// corresponding unref happens in on_status_received_ instead of here.
|
680
781
|
}
|
681
782
|
|
682
783
|
void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
|
683
|
-
const std::string& type_url
|
684
|
-
grpc_error* error_for_unsupported_type, bool is_first_message) {
|
784
|
+
const std::string& type_url) {
|
685
785
|
// Buffer message sending if an existing message is in flight.
|
686
786
|
if (send_message_payload_ != nullptr) {
|
687
|
-
|
688
|
-
nonce_for_unsupported_type, error_for_unsupported_type));
|
787
|
+
buffered_requests_.insert(type_url);
|
689
788
|
return;
|
690
789
|
}
|
790
|
+
auto& state = state_map_[type_url];
|
791
|
+
grpc_error* error = state.error;
|
792
|
+
state.error = GRPC_ERROR_NONE;
|
691
793
|
grpc_slice request_payload_slice;
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
} else if (type_url ==
|
703
|
-
request_payload_slice =
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
794
|
+
if (type_url == XdsApi::kLdsTypeUrl) {
|
795
|
+
request_payload_slice = xds_client()->api_.CreateLdsRequest(
|
796
|
+
xds_client()->server_name_, state.version, state.nonce, error,
|
797
|
+
!sent_initial_message_);
|
798
|
+
state.subscribed_resources[xds_client()->server_name_]->Start(Ref());
|
799
|
+
} else if (type_url == XdsApi::kRdsTypeUrl) {
|
800
|
+
request_payload_slice = xds_client()->api_.CreateRdsRequest(
|
801
|
+
xds_client()->route_config_name_, state.version, state.nonce, error,
|
802
|
+
!sent_initial_message_);
|
803
|
+
state.subscribed_resources[xds_client()->route_config_name_]->Start(Ref());
|
804
|
+
} else if (type_url == XdsApi::kCdsTypeUrl) {
|
805
|
+
request_payload_slice = xds_client()->api_.CreateCdsRequest(
|
806
|
+
ClusterNamesForRequest(), state.version, state.nonce, error,
|
807
|
+
!sent_initial_message_);
|
808
|
+
} else if (type_url == XdsApi::kEdsTypeUrl) {
|
809
|
+
request_payload_slice = xds_client()->api_.CreateEdsRequest(
|
810
|
+
EdsServiceNamesForRequest(), state.version, state.nonce, error,
|
811
|
+
!sent_initial_message_);
|
708
812
|
} else {
|
709
|
-
request_payload_slice =
|
710
|
-
type_url,
|
813
|
+
request_payload_slice = xds_client()->api_.CreateUnsupportedTypeNackRequest(
|
814
|
+
type_url, state.nonce, state.error);
|
815
|
+
state_map_.erase(type_url);
|
711
816
|
}
|
817
|
+
sent_initial_message_ = true;
|
712
818
|
// Create message payload.
|
713
819
|
send_message_payload_ =
|
714
820
|
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
|
@@ -731,11 +837,118 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
|
|
731
837
|
}
|
732
838
|
}
|
733
839
|
|
840
|
+
void XdsClient::ChannelState::AdsCallState::Subscribe(
|
841
|
+
const std::string& type_url, const std::string& name) {
|
842
|
+
auto& state = state_map_[type_url].subscribed_resources[name];
|
843
|
+
if (state == nullptr) {
|
844
|
+
state = MakeOrphanable<ResourceState>(type_url, name);
|
845
|
+
SendMessageLocked(type_url);
|
846
|
+
}
|
847
|
+
}
|
848
|
+
|
849
|
+
void XdsClient::ChannelState::AdsCallState::Unsubscribe(
|
850
|
+
const std::string& type_url, const std::string& name) {
|
851
|
+
state_map_[type_url].subscribed_resources.erase(name);
|
852
|
+
SendMessageLocked(type_url);
|
853
|
+
}
|
854
|
+
|
855
|
+
bool XdsClient::ChannelState::AdsCallState::HasSubscribedResources() const {
|
856
|
+
for (const auto& p : state_map_) {
|
857
|
+
if (!p.second.subscribed_resources.empty()) return true;
|
858
|
+
}
|
859
|
+
return false;
|
860
|
+
}
|
861
|
+
|
862
|
+
void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdate(
|
863
|
+
XdsApi::LdsUpdate lds_update) {
|
864
|
+
const std::string& cluster_name =
|
865
|
+
lds_update.rds_update.has_value()
|
866
|
+
? lds_update.rds_update.value().cluster_name
|
867
|
+
: "";
|
868
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
869
|
+
gpr_log(GPR_INFO,
|
870
|
+
"[xds_client %p] LDS update received: "
|
871
|
+
"route_config_name=%s, "
|
872
|
+
"cluster_name=%s (empty if RDS is needed to obtain it)",
|
873
|
+
xds_client(), lds_update.route_config_name.c_str(),
|
874
|
+
cluster_name.c_str());
|
875
|
+
}
|
876
|
+
auto& lds_state = state_map_[XdsApi::kLdsTypeUrl];
|
877
|
+
auto& state = lds_state.subscribed_resources[xds_client()->server_name_];
|
878
|
+
if (state != nullptr) state->Finish();
|
879
|
+
// Ignore identical update.
|
880
|
+
if (xds_client()->route_config_name_ == lds_update.route_config_name &&
|
881
|
+
xds_client()->cluster_name_ == cluster_name) {
|
882
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
883
|
+
gpr_log(GPR_INFO,
|
884
|
+
"[xds_client %p] LDS update identical to current, ignoring.",
|
885
|
+
xds_client());
|
886
|
+
}
|
887
|
+
return;
|
888
|
+
}
|
889
|
+
xds_client()->route_config_name_ = std::move(lds_update.route_config_name);
|
890
|
+
if (lds_update.rds_update.has_value()) {
|
891
|
+
// If cluster_name was found inlined in LDS response, notify the watcher
|
892
|
+
// immediately.
|
893
|
+
xds_client()->cluster_name_ =
|
894
|
+
std::move(lds_update.rds_update.value().cluster_name);
|
895
|
+
RefCountedPtr<ServiceConfig> service_config;
|
896
|
+
grpc_error* error = xds_client()->CreateServiceConfig(
|
897
|
+
xds_client()->cluster_name_, &service_config);
|
898
|
+
if (error == GRPC_ERROR_NONE) {
|
899
|
+
xds_client()->service_config_watcher_->OnServiceConfigChanged(
|
900
|
+
std::move(service_config));
|
901
|
+
} else {
|
902
|
+
xds_client()->service_config_watcher_->OnError(error);
|
903
|
+
}
|
904
|
+
} else {
|
905
|
+
// Send RDS request for dynamic resolution.
|
906
|
+
Subscribe(XdsApi::kRdsTypeUrl, xds_client()->route_config_name_);
|
907
|
+
}
|
908
|
+
}
|
909
|
+
|
910
|
+
void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdate(
|
911
|
+
XdsApi::RdsUpdate rds_update) {
|
912
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
913
|
+
gpr_log(GPR_INFO,
|
914
|
+
"[xds_client %p] RDS update received: "
|
915
|
+
"cluster_name=%s",
|
916
|
+
xds_client(), rds_update.cluster_name.c_str());
|
917
|
+
}
|
918
|
+
auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
|
919
|
+
auto& state =
|
920
|
+
rds_state.subscribed_resources[xds_client()->route_config_name_];
|
921
|
+
if (state != nullptr) state->Finish();
|
922
|
+
// Ignore identical update.
|
923
|
+
if (xds_client()->cluster_name_ == rds_update.cluster_name) {
|
924
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
925
|
+
gpr_log(GPR_INFO,
|
926
|
+
"[xds_client %p] RDS update identical to current, ignoring.",
|
927
|
+
xds_client());
|
928
|
+
}
|
929
|
+
return;
|
930
|
+
}
|
931
|
+
xds_client()->cluster_name_ = std::move(rds_update.cluster_name);
|
932
|
+
// Notify the watcher.
|
933
|
+
RefCountedPtr<ServiceConfig> service_config;
|
934
|
+
grpc_error* error = xds_client()->CreateServiceConfig(
|
935
|
+
xds_client()->cluster_name_, &service_config);
|
936
|
+
if (error == GRPC_ERROR_NONE) {
|
937
|
+
xds_client()->service_config_watcher_->OnServiceConfigChanged(
|
938
|
+
std::move(service_config));
|
939
|
+
} else {
|
940
|
+
xds_client()->service_config_watcher_->OnError(error);
|
941
|
+
}
|
942
|
+
}
|
943
|
+
|
734
944
|
void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
|
735
|
-
CdsUpdateMap cds_update_map
|
945
|
+
XdsApi::CdsUpdateMap cds_update_map) {
|
946
|
+
auto& cds_state = state_map_[XdsApi::kCdsTypeUrl];
|
736
947
|
for (auto& p : cds_update_map) {
|
737
948
|
const char* cluster_name = p.first.c_str();
|
738
|
-
CdsUpdate& cds_update = p.second;
|
949
|
+
XdsApi::CdsUpdate& cds_update = p.second;
|
950
|
+
auto& state = cds_state.subscribed_resources[cluster_name];
|
951
|
+
if (state != nullptr) state->Finish();
|
739
952
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
740
953
|
gpr_log(GPR_INFO,
|
741
954
|
"[xds_client %p] CDS update (cluster=%s) received: "
|
@@ -762,20 +975,22 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
|
|
762
975
|
continue;
|
763
976
|
}
|
764
977
|
// Update the cluster state.
|
765
|
-
cluster_state.update.
|
978
|
+
cluster_state.update.emplace(std::move(cds_update));
|
766
979
|
// Notify all watchers.
|
767
980
|
for (const auto& p : cluster_state.watchers) {
|
768
981
|
p.first->OnClusterChanged(cluster_state.update.value());
|
769
982
|
}
|
770
983
|
}
|
771
|
-
cds_version_.version_info = std::move(new_version);
|
772
984
|
}
|
773
985
|
|
774
986
|
void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdate(
|
775
|
-
EdsUpdateMap eds_update_map
|
987
|
+
XdsApi::EdsUpdateMap eds_update_map) {
|
988
|
+
auto& eds_state = state_map_[XdsApi::kEdsTypeUrl];
|
776
989
|
for (auto& p : eds_update_map) {
|
777
990
|
const char* eds_service_name = p.first.c_str();
|
778
|
-
EdsUpdate& eds_update = p.second;
|
991
|
+
XdsApi::EdsUpdate& eds_update = p.second;
|
992
|
+
auto& state = eds_state.subscribed_resources[eds_service_name];
|
993
|
+
if (state != nullptr) state->Finish();
|
779
994
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
780
995
|
gpr_log(GPR_INFO,
|
781
996
|
"[xds_client %p] EDS response with %" PRIuPTR
|
@@ -797,9 +1012,9 @@ void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdate(
|
|
797
1012
|
const auto& locality = p.second;
|
798
1013
|
gpr_log(GPR_INFO,
|
799
1014
|
"[xds_client %p] Priority %" PRIuPTR ", locality %" PRIuPTR
|
800
|
-
" %s contains %" PRIuPTR " server addresses",
|
1015
|
+
" %s has weight %d, contains %" PRIuPTR " server addresses",
|
801
1016
|
xds_client(), priority, locality_count,
|
802
|
-
locality.name->AsHumanReadableString(),
|
1017
|
+
locality.name->AsHumanReadableString(), locality.lb_weight,
|
803
1018
|
locality.serverlist.size());
|
804
1019
|
for (size_t i = 0; i < locality.serverlist.size(); ++i) {
|
805
1020
|
char* ipport;
|
@@ -817,7 +1032,7 @@ void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdate(
|
|
817
1032
|
}
|
818
1033
|
for (size_t i = 0;
|
819
1034
|
i < eds_update.drop_config->drop_category_list().size(); ++i) {
|
820
|
-
const
|
1035
|
+
const XdsApi::DropConfig::DropCategory& drop_category =
|
821
1036
|
eds_update.drop_config->drop_category_list()[i];
|
822
1037
|
gpr_log(GPR_INFO,
|
823
1038
|
"[xds_client %p] Drop category %s has drop rate %d per million",
|
@@ -828,7 +1043,7 @@ void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdate(
|
|
828
1043
|
EndpointState& endpoint_state =
|
829
1044
|
xds_client()->endpoint_map_[eds_service_name];
|
830
1045
|
// Ignore identical update.
|
831
|
-
const EdsUpdate& prev_update = endpoint_state.update;
|
1046
|
+
const XdsApi::EdsUpdate& prev_update = endpoint_state.update;
|
832
1047
|
const bool priority_list_changed =
|
833
1048
|
prev_update.priority_list_update != eds_update.priority_list_update;
|
834
1049
|
const bool drop_config_changed =
|
@@ -849,7 +1064,6 @@ void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdate(
|
|
849
1064
|
p.first->OnEndpointChanged(endpoint_state.update);
|
850
1065
|
}
|
851
1066
|
}
|
852
|
-
eds_version_.version_info = std::move(new_version);
|
853
1067
|
}
|
854
1068
|
|
855
1069
|
void XdsClient::ChannelState::AdsCallState::OnRequestSent(void* arg,
|
@@ -870,22 +1084,17 @@ void XdsClient::ChannelState::AdsCallState::OnRequestSentLocked(
|
|
870
1084
|
self->send_message_payload_ = nullptr;
|
871
1085
|
// Continue to send another pending message if any.
|
872
1086
|
// TODO(roth): The current code to handle buffered messages has the
|
873
|
-
// advantage of sending only the most recent list of resource names for
|
874
|
-
// resource type (no matter how many times that resource type has
|
875
|
-
// requested to send while the current message sending is still
|
876
|
-
// But its disadvantage is that we send the requests in fixed
|
877
|
-
// resource types. We need to fix this if we are seeing some
|
878
|
-
// type(s) starved due to frequent requests of other resource
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
buffered_request->error, false);
|
885
|
-
buffered_request->error = GRPC_ERROR_NONE;
|
886
|
-
buffered_request.reset();
|
887
|
-
break;
|
888
|
-
}
|
1087
|
+
// advantage of sending only the most recent list of resource names for
|
1088
|
+
// each resource type (no matter how many times that resource type has
|
1089
|
+
// been requested to send while the current message sending is still
|
1090
|
+
// pending). But its disadvantage is that we send the requests in fixed
|
1091
|
+
// order of resource types. We need to fix this if we are seeing some
|
1092
|
+
// resource type(s) starved due to frequent requests of other resource
|
1093
|
+
// type(s).
|
1094
|
+
auto it = self->buffered_requests_.begin();
|
1095
|
+
if (it != self->buffered_requests_.end()) {
|
1096
|
+
self->SendMessageLocked(*it);
|
1097
|
+
self->buffered_requests_.erase(it);
|
889
1098
|
}
|
890
1099
|
}
|
891
1100
|
self->Unref(DEBUG_LOCATION, "ADS+OnRequestSentLocked");
|
@@ -926,15 +1135,18 @@ void XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked(
|
|
926
1135
|
// mode. We will also need to cancel the timer when we receive a serverlist
|
927
1136
|
// from the balancer.
|
928
1137
|
// Parse the response.
|
929
|
-
|
930
|
-
|
1138
|
+
XdsApi::LdsUpdate lds_update;
|
1139
|
+
XdsApi::RdsUpdate rds_update;
|
1140
|
+
XdsApi::CdsUpdateMap cds_update_map;
|
1141
|
+
XdsApi::EdsUpdateMap eds_update_map;
|
931
1142
|
std::string version;
|
932
1143
|
std::string nonce;
|
933
1144
|
std::string type_url;
|
934
|
-
// Note that
|
935
|
-
grpc_error* parse_error =
|
936
|
-
response_slice, xds_client->
|
937
|
-
|
1145
|
+
// Note that ParseAdsResponse() also validates the response.
|
1146
|
+
grpc_error* parse_error = xds_client->api_.ParseAdsResponse(
|
1147
|
+
response_slice, xds_client->server_name_, xds_client->route_config_name_,
|
1148
|
+
ads_calld->EdsServiceNamesForRequest(), &lds_update, &rds_update,
|
1149
|
+
&cds_update_map, &eds_update_map, &version, &nonce, &type_url);
|
938
1150
|
grpc_slice_unref_internal(response_slice);
|
939
1151
|
if (type_url.empty()) {
|
940
1152
|
// Ignore unparsable response.
|
@@ -942,36 +1154,34 @@ void XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked(
|
|
942
1154
|
xds_client, grpc_error_string(parse_error));
|
943
1155
|
GRPC_ERROR_UNREF(parse_error);
|
944
1156
|
} else {
|
945
|
-
// Update nonce
|
946
|
-
|
947
|
-
|
948
|
-
GRPC_ERROR_UNREF(ads_calld->cds_version_.error);
|
949
|
-
ads_calld->cds_version_.error = GRPC_ERROR_REF(parse_error);
|
950
|
-
} else if (type_url == kEdsTypeUrl) {
|
951
|
-
ads_calld->eds_version_.nonce = nonce;
|
952
|
-
GRPC_ERROR_UNREF(ads_calld->eds_version_.error);
|
953
|
-
ads_calld->eds_version_.error = GRPC_ERROR_REF(parse_error);
|
954
|
-
}
|
1157
|
+
// Update nonce.
|
1158
|
+
auto& state = ads_calld->state_map_[type_url];
|
1159
|
+
state.nonce = std::move(nonce);
|
955
1160
|
// NACK or ACK the response.
|
956
1161
|
if (parse_error != GRPC_ERROR_NONE) {
|
1162
|
+
GRPC_ERROR_UNREF(state.error);
|
1163
|
+
state.error = parse_error;
|
957
1164
|
// NACK unacceptable update.
|
958
1165
|
gpr_log(
|
959
1166
|
GPR_ERROR,
|
960
1167
|
"[xds_client %p] ADS response can't be accepted, NACKing. error=%s",
|
961
1168
|
xds_client, grpc_error_string(parse_error));
|
962
|
-
ads_calld->SendMessageLocked(type_url
|
1169
|
+
ads_calld->SendMessageLocked(type_url);
|
963
1170
|
} else {
|
964
1171
|
ads_calld->seen_response_ = true;
|
965
|
-
// Accept the
|
966
|
-
if (type_url ==
|
967
|
-
ads_calld->
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
1172
|
+
// Accept the ADS response according to the type_url.
|
1173
|
+
if (type_url == XdsApi::kLdsTypeUrl) {
|
1174
|
+
ads_calld->AcceptLdsUpdate(std::move(lds_update));
|
1175
|
+
} else if (type_url == XdsApi::kRdsTypeUrl) {
|
1176
|
+
ads_calld->AcceptRdsUpdate(std::move(rds_update));
|
1177
|
+
} else if (type_url == XdsApi::kCdsTypeUrl) {
|
1178
|
+
ads_calld->AcceptCdsUpdate(std::move(cds_update_map));
|
1179
|
+
} else if (type_url == XdsApi::kEdsTypeUrl) {
|
1180
|
+
ads_calld->AcceptEdsUpdate(std::move(eds_update_map));
|
972
1181
|
}
|
1182
|
+
state.version = std::move(version);
|
973
1183
|
// ACK the update.
|
974
|
-
ads_calld->SendMessageLocked(type_url
|
1184
|
+
ads_calld->SendMessageLocked(type_url);
|
975
1185
|
// Start load reporting if needed.
|
976
1186
|
auto& lrs_call = ads_calld->chand()->lrs_calld_;
|
977
1187
|
if (lrs_call != nullptr) {
|
@@ -1042,6 +1252,28 @@ bool XdsClient::ChannelState::AdsCallState::IsCurrentCallOnChannel() const {
|
|
1042
1252
|
return this == chand()->ads_calld_->calld();
|
1043
1253
|
}
|
1044
1254
|
|
1255
|
+
std::set<StringView>
|
1256
|
+
XdsClient::ChannelState::AdsCallState::ClusterNamesForRequest() {
|
1257
|
+
std::set<StringView> cluster_names;
|
1258
|
+
for (auto& p : state_map_[XdsApi::kCdsTypeUrl].subscribed_resources) {
|
1259
|
+
cluster_names.insert(p.first);
|
1260
|
+
OrphanablePtr<ResourceState>& state = p.second;
|
1261
|
+
state->Start(Ref());
|
1262
|
+
}
|
1263
|
+
return cluster_names;
|
1264
|
+
}
|
1265
|
+
|
1266
|
+
std::set<StringView>
|
1267
|
+
XdsClient::ChannelState::AdsCallState::EdsServiceNamesForRequest() {
|
1268
|
+
std::set<StringView> eds_names;
|
1269
|
+
for (auto& p : state_map_[XdsApi::kEdsTypeUrl].subscribed_resources) {
|
1270
|
+
eds_names.insert(p.first);
|
1271
|
+
OrphanablePtr<ResourceState>& state = p.second;
|
1272
|
+
state->Start(Ref());
|
1273
|
+
}
|
1274
|
+
return eds_names;
|
1275
|
+
}
|
1276
|
+
|
1045
1277
|
//
|
1046
1278
|
// XdsClient::ChannelState::LrsCallState::Reporter
|
1047
1279
|
//
|
@@ -1082,19 +1314,39 @@ void XdsClient::ChannelState::LrsCallState::Reporter::OnNextReportTimerLocked(
|
|
1082
1314
|
self->SendReportLocked();
|
1083
1315
|
}
|
1084
1316
|
|
1317
|
+
namespace {
|
1318
|
+
|
1319
|
+
bool LoadReportCountersAreZero(const XdsApi::ClusterLoadReportMap& snapshot) {
|
1320
|
+
for (const auto& p : snapshot) {
|
1321
|
+
const XdsApi::ClusterLoadReport& cluster_snapshot = p.second;
|
1322
|
+
for (const auto& q : cluster_snapshot.dropped_requests) {
|
1323
|
+
if (q.second > 0) return false;
|
1324
|
+
}
|
1325
|
+
for (const auto& q : cluster_snapshot.locality_stats) {
|
1326
|
+
const XdsClusterLocalityStats::Snapshot& locality_snapshot = q.second;
|
1327
|
+
if (!locality_snapshot.IsZero()) return false;
|
1328
|
+
}
|
1329
|
+
}
|
1330
|
+
return true;
|
1331
|
+
}
|
1332
|
+
|
1333
|
+
} // namespace
|
1334
|
+
|
1085
1335
|
void XdsClient::ChannelState::LrsCallState::Reporter::SendReportLocked() {
|
1086
|
-
//
|
1087
|
-
|
1088
|
-
|
1336
|
+
// Construct snapshot from all reported stats.
|
1337
|
+
XdsApi::ClusterLoadReportMap snapshot =
|
1338
|
+
xds_client()->BuildLoadReportSnapshot();
|
1089
1339
|
// Skip client load report if the counters were all zero in the last
|
1090
1340
|
// report and they are still zero in this one.
|
1091
1341
|
const bool old_val = last_report_counters_were_zero_;
|
1092
|
-
last_report_counters_were_zero_ =
|
1093
|
-
grpc_slice_eq(request_payload_slice, grpc_empty_slice()));
|
1342
|
+
last_report_counters_were_zero_ = LoadReportCountersAreZero(snapshot);
|
1094
1343
|
if (old_val && last_report_counters_were_zero_) {
|
1095
1344
|
ScheduleNextReportLocked();
|
1096
1345
|
return;
|
1097
1346
|
}
|
1347
|
+
// Create a request that contains the snapshot.
|
1348
|
+
grpc_slice request_payload_slice =
|
1349
|
+
xds_client()->api_.CreateLrsRequest(std::move(snapshot));
|
1098
1350
|
parent_->send_message_payload_ =
|
1099
1351
|
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
|
1100
1352
|
grpc_slice_unref_internal(request_payload_slice);
|
@@ -1161,9 +1413,8 @@ XdsClient::ChannelState::LrsCallState::LrsCallState(
|
|
1161
1413
|
nullptr, GRPC_MILLIS_INF_FUTURE, nullptr);
|
1162
1414
|
GPR_ASSERT(call_ != nullptr);
|
1163
1415
|
// Init the request payload.
|
1164
|
-
grpc_slice request_payload_slice =
|
1165
|
-
xds_client()->
|
1166
|
-
xds_client()->build_version_.get());
|
1416
|
+
grpc_slice request_payload_slice =
|
1417
|
+
xds_client()->api_.CreateLrsInitialRequest(xds_client()->server_name_);
|
1167
1418
|
send_message_payload_ =
|
1168
1419
|
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
|
1169
1420
|
grpc_slice_unref_internal(request_payload_slice);
|
@@ -1276,11 +1527,6 @@ void XdsClient::ChannelState::LrsCallState::MaybeStartReportingLocked() {
|
|
1276
1527
|
AdsCallState* ads_calld = chand()->ads_calld_->calld();
|
1277
1528
|
if (ads_calld == nullptr || !ads_calld->seen_response()) return;
|
1278
1529
|
// Start reporting.
|
1279
|
-
for (auto& p : chand()->xds_client_->endpoint_map_) {
|
1280
|
-
for (auto* client_stats : p.second.client_stats) {
|
1281
|
-
client_stats->MaybeInitLastReportTime();
|
1282
|
-
}
|
1283
|
-
}
|
1284
1530
|
reporter_ = MakeOrphanable<Reporter>(
|
1285
1531
|
Ref(DEBUG_LOCATION, "LRS+load_report+start"), load_reporting_interval_);
|
1286
1532
|
}
|
@@ -1342,7 +1588,7 @@ void XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked(
|
|
1342
1588
|
// Parse the response.
|
1343
1589
|
std::set<std::string> new_cluster_names;
|
1344
1590
|
grpc_millis new_load_reporting_interval;
|
1345
|
-
grpc_error* parse_error =
|
1591
|
+
grpc_error* parse_error = xds_client->api_.ParseLrsResponse(
|
1346
1592
|
response_slice, &new_cluster_names, &new_load_reporting_interval);
|
1347
1593
|
if (parse_error != GRPC_ERROR_NONE) {
|
1348
1594
|
gpr_log(GPR_ERROR,
|
@@ -1462,11 +1708,10 @@ bool XdsClient::ChannelState::LrsCallState::IsCurrentCallOnChannel() const {
|
|
1462
1708
|
|
1463
1709
|
namespace {
|
1464
1710
|
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
return grpc_core::UniquePtr<char>(build_version_str);
|
1711
|
+
grpc_millis GetRequestTimeout(const grpc_channel_args& args) {
|
1712
|
+
return grpc_channel_args_find_integer(
|
1713
|
+
&args, GRPC_ARG_XDS_RESOURCE_DOES_NOT_EXIST_TIMEOUT_MS,
|
1714
|
+
{15000, 0, INT_MAX});
|
1470
1715
|
}
|
1471
1716
|
|
1472
1717
|
} // namespace
|
@@ -1476,31 +1721,34 @@ XdsClient::XdsClient(Combiner* combiner, grpc_pollset_set* interested_parties,
|
|
1476
1721
|
std::unique_ptr<ServiceConfigWatcherInterface> watcher,
|
1477
1722
|
const grpc_channel_args& channel_args, grpc_error** error)
|
1478
1723
|
: InternallyRefCounted<XdsClient>(&grpc_xds_client_trace),
|
1479
|
-
|
1724
|
+
request_timeout_(GetRequestTimeout(channel_args)),
|
1480
1725
|
combiner_(GRPC_COMBINER_REF(combiner, "xds_client")),
|
1481
1726
|
interested_parties_(interested_parties),
|
1482
1727
|
bootstrap_(XdsBootstrap::ReadFromFile(error)),
|
1728
|
+
api_(bootstrap_ == nullptr ? nullptr : bootstrap_->node()),
|
1483
1729
|
server_name_(server_name),
|
1484
1730
|
service_config_watcher_(std::move(watcher)) {
|
1485
1731
|
if (*error != GRPC_ERROR_NONE) {
|
1486
|
-
|
1487
|
-
|
1488
|
-
this, grpc_error_string(*error));
|
1489
|
-
}
|
1732
|
+
gpr_log(GPR_ERROR, "[xds_client %p] failed to read bootstrap file: %s",
|
1733
|
+
this, grpc_error_string(*error));
|
1490
1734
|
return;
|
1491
1735
|
}
|
1492
1736
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1493
|
-
gpr_log(GPR_INFO, "[xds_client %p
|
1494
|
-
bootstrap_->server().server_uri);
|
1737
|
+
gpr_log(GPR_INFO, "[xds_client %p] creating channel to %s", this,
|
1738
|
+
bootstrap_->server().server_uri.c_str());
|
1739
|
+
}
|
1740
|
+
grpc_channel_args* new_args = BuildXdsChannelArgs(channel_args);
|
1741
|
+
grpc_channel* channel = CreateXdsChannel(*bootstrap_, *new_args, error);
|
1742
|
+
grpc_channel_args_destroy(new_args);
|
1743
|
+
if (*error != GRPC_ERROR_NONE) {
|
1744
|
+
gpr_log(GPR_ERROR, "[xds_client %p] failed to create xds channel: %s", this,
|
1745
|
+
grpc_error_string(*error));
|
1746
|
+
return;
|
1495
1747
|
}
|
1496
1748
|
chand_ = MakeOrphanable<ChannelState>(
|
1497
|
-
Ref(DEBUG_LOCATION, "XdsClient+ChannelState"),
|
1749
|
+
Ref(DEBUG_LOCATION, "XdsClient+ChannelState"), channel);
|
1498
1750
|
if (service_config_watcher_ != nullptr) {
|
1499
|
-
|
1500
|
-
// until we get the first LDS response.
|
1501
|
-
GRPC_CLOSURE_INIT(&service_config_notify_, NotifyOnServiceConfig,
|
1502
|
-
Ref().release(), nullptr);
|
1503
|
-
combiner_->Run(&service_config_notify_, GRPC_ERROR_NONE);
|
1751
|
+
chand_->Subscribe(XdsApi::kLdsTypeUrl, std::string(server_name));
|
1504
1752
|
}
|
1505
1753
|
}
|
1506
1754
|
|
@@ -1509,15 +1757,23 @@ XdsClient::~XdsClient() { GRPC_COMBINER_UNREF(combiner_, "xds_client"); }
|
|
1509
1757
|
void XdsClient::Orphan() {
|
1510
1758
|
shutting_down_ = true;
|
1511
1759
|
chand_.reset();
|
1512
|
-
cluster_map_
|
1513
|
-
|
1760
|
+
// We do not clear cluster_map_ and endpoint_map_ if the xds client was
|
1761
|
+
// created by the XdsResolver because the maps contain refs for watchers which
|
1762
|
+
// in turn hold refs to the loadbalancing policies. At this point, it is
|
1763
|
+
// possible for ADS calls to be in progress. Unreffing the loadbalancing
|
1764
|
+
// policies before those calls are done would lead to issues such as
|
1765
|
+
// https://github.com/grpc/grpc/issues/20928.
|
1766
|
+
if (service_config_watcher_ != nullptr) {
|
1767
|
+
cluster_map_.clear();
|
1768
|
+
endpoint_map_.clear();
|
1769
|
+
}
|
1514
1770
|
Unref(DEBUG_LOCATION, "XdsClient::Orphan()");
|
1515
1771
|
}
|
1516
1772
|
|
1517
1773
|
void XdsClient::WatchClusterData(
|
1518
1774
|
StringView cluster_name, std::unique_ptr<ClusterWatcherInterface> watcher) {
|
1519
|
-
|
1520
|
-
ClusterState& cluster_state = cluster_map_[
|
1775
|
+
std::string cluster_name_str = std::string(cluster_name);
|
1776
|
+
ClusterState& cluster_state = cluster_map_[cluster_name_str];
|
1521
1777
|
ClusterWatcherInterface* w = watcher.get();
|
1522
1778
|
cluster_state.watchers[w] = std::move(watcher);
|
1523
1779
|
// If we've already received an CDS update, notify the new watcher
|
@@ -1525,30 +1781,29 @@ void XdsClient::WatchClusterData(
|
|
1525
1781
|
if (cluster_state.update.has_value()) {
|
1526
1782
|
w->OnClusterChanged(cluster_state.update.value());
|
1527
1783
|
}
|
1528
|
-
|
1784
|
+
chand_->Subscribe(XdsApi::kCdsTypeUrl, cluster_name_str);
|
1529
1785
|
}
|
1530
1786
|
|
1531
1787
|
void XdsClient::CancelClusterDataWatch(StringView cluster_name,
|
1532
1788
|
ClusterWatcherInterface* watcher) {
|
1533
1789
|
if (shutting_down_) return;
|
1534
|
-
|
1790
|
+
std::string cluster_name_str = std::string(cluster_name);
|
1791
|
+
ClusterState& cluster_state = cluster_map_[cluster_name_str];
|
1535
1792
|
auto it = cluster_state.watchers.find(watcher);
|
1536
1793
|
if (it != cluster_state.watchers.end()) {
|
1537
1794
|
cluster_state.watchers.erase(it);
|
1538
1795
|
if (cluster_state.watchers.empty()) {
|
1539
|
-
cluster_map_.erase(
|
1540
|
-
chand_->
|
1796
|
+
cluster_map_.erase(cluster_name_str);
|
1797
|
+
chand_->Unsubscribe(XdsApi::kCdsTypeUrl, cluster_name_str);
|
1541
1798
|
}
|
1542
1799
|
}
|
1543
|
-
chand_->OnWatcherRemoved();
|
1544
1800
|
}
|
1545
1801
|
|
1546
1802
|
void XdsClient::WatchEndpointData(
|
1547
1803
|
StringView eds_service_name,
|
1548
1804
|
std::unique_ptr<EndpointWatcherInterface> watcher) {
|
1549
|
-
|
1550
|
-
|
1551
|
-
EndpointState& endpoint_state = endpoint_map_[eds_service_name];
|
1805
|
+
std::string eds_service_name_str = std::string(eds_service_name);
|
1806
|
+
EndpointState& endpoint_state = endpoint_map_[eds_service_name_str];
|
1552
1807
|
EndpointWatcherInterface* w = watcher.get();
|
1553
1808
|
endpoint_state.watchers[w] = std::move(watcher);
|
1554
1809
|
// If we've already received an EDS update, notify the new watcher
|
@@ -1556,90 +1811,178 @@ void XdsClient::WatchEndpointData(
|
|
1556
1811
|
if (!endpoint_state.update.priority_list_update.empty()) {
|
1557
1812
|
w->OnEndpointChanged(endpoint_state.update);
|
1558
1813
|
}
|
1559
|
-
|
1814
|
+
chand_->Subscribe(XdsApi::kEdsTypeUrl, eds_service_name_str);
|
1560
1815
|
}
|
1561
1816
|
|
1562
1817
|
void XdsClient::CancelEndpointDataWatch(StringView eds_service_name,
|
1563
1818
|
EndpointWatcherInterface* watcher) {
|
1564
1819
|
if (shutting_down_) return;
|
1565
|
-
|
1820
|
+
std::string eds_service_name_str = std::string(eds_service_name);
|
1821
|
+
EndpointState& endpoint_state = endpoint_map_[eds_service_name_str];
|
1566
1822
|
auto it = endpoint_state.watchers.find(watcher);
|
1567
1823
|
if (it != endpoint_state.watchers.end()) {
|
1568
1824
|
endpoint_state.watchers.erase(it);
|
1569
1825
|
if (endpoint_state.watchers.empty()) {
|
1570
|
-
endpoint_map_.erase(
|
1571
|
-
chand_->
|
1826
|
+
endpoint_map_.erase(eds_service_name_str);
|
1827
|
+
chand_->Unsubscribe(XdsApi::kEdsTypeUrl, eds_service_name_str);
|
1572
1828
|
}
|
1573
1829
|
}
|
1574
|
-
chand_->OnWatcherRemoved();
|
1575
1830
|
}
|
1576
1831
|
|
1577
|
-
|
1578
|
-
|
1579
|
-
|
1580
|
-
EndpointState& endpoint_state = endpoint_map_[cluster_name];
|
1832
|
+
RefCountedPtr<XdsClusterDropStats> XdsClient::AddClusterDropStats(
|
1833
|
+
StringView lrs_server, StringView cluster_name,
|
1834
|
+
StringView eds_service_name) {
|
1581
1835
|
// TODO(roth): When we add support for direct federation, use the
|
1582
1836
|
// server name specified in lrs_server.
|
1583
|
-
|
1837
|
+
auto key =
|
1838
|
+
std::make_pair(std::string(cluster_name), std::string(eds_service_name));
|
1839
|
+
// We jump through some hoops here to make sure that the StringViews
|
1840
|
+
// stored in the XdsClusterDropStats object point to the strings
|
1841
|
+
// in the load_report_map_ key, so that they have the same lifetime.
|
1842
|
+
auto it = load_report_map_
|
1843
|
+
.emplace(std::make_pair(std::move(key), LoadReportState()))
|
1844
|
+
.first;
|
1845
|
+
auto cluster_drop_stats = MakeRefCounted<XdsClusterDropStats>(
|
1846
|
+
Ref(DEBUG_LOCATION, "DropStats"), lrs_server,
|
1847
|
+
it->first.first /*cluster_name*/, it->first.second /*eds_service_name*/);
|
1848
|
+
it->second.drop_stats.insert(cluster_drop_stats.get());
|
1584
1849
|
chand_->MaybeStartLrsCall();
|
1850
|
+
return cluster_drop_stats;
|
1585
1851
|
}
|
1586
1852
|
|
1587
|
-
void XdsClient::
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1853
|
+
void XdsClient::RemoveClusterDropStats(
|
1854
|
+
StringView /*lrs_server*/, StringView cluster_name,
|
1855
|
+
StringView eds_service_name, XdsClusterDropStats* cluster_drop_stats) {
|
1856
|
+
auto load_report_it = load_report_map_.find(
|
1857
|
+
std::make_pair(std::string(cluster_name), std::string(eds_service_name)));
|
1858
|
+
if (load_report_it == load_report_map_.end()) return;
|
1859
|
+
LoadReportState& load_report_state = load_report_it->second;
|
1591
1860
|
// TODO(roth): When we add support for direct federation, use the
|
1592
1861
|
// server name specified in lrs_server.
|
1593
1862
|
// TODO(roth): In principle, we should try to send a final load report
|
1594
1863
|
// containing whatever final stats have been accumulated since the
|
1595
1864
|
// last load report.
|
1596
|
-
auto it =
|
1597
|
-
if (it !=
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1865
|
+
auto it = load_report_state.drop_stats.find(cluster_drop_stats);
|
1866
|
+
if (it != load_report_state.drop_stats.end()) {
|
1867
|
+
load_report_state.drop_stats.erase(it);
|
1868
|
+
if (load_report_state.drop_stats.empty() &&
|
1869
|
+
load_report_state.locality_stats.empty()) {
|
1870
|
+
load_report_map_.erase(load_report_it);
|
1871
|
+
if (chand_ != nullptr && load_report_map_.empty()) {
|
1872
|
+
chand_->StopLrsCall();
|
1873
|
+
}
|
1874
|
+
}
|
1602
1875
|
}
|
1603
1876
|
}
|
1604
1877
|
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1878
|
+
RefCountedPtr<XdsClusterLocalityStats> XdsClient::AddClusterLocalityStats(
|
1879
|
+
StringView lrs_server, StringView cluster_name, StringView eds_service_name,
|
1880
|
+
RefCountedPtr<XdsLocalityName> locality) {
|
1881
|
+
// TODO(roth): When we add support for direct federation, use the
|
1882
|
+
// server name specified in lrs_server.
|
1883
|
+
auto key =
|
1884
|
+
std::make_pair(std::string(cluster_name), std::string(eds_service_name));
|
1885
|
+
// We jump through some hoops here to make sure that the StringViews
|
1886
|
+
// stored in the XdsClusterLocalityStats object point to the strings
|
1887
|
+
// in the load_report_map_ key, so that they have the same lifetime.
|
1888
|
+
auto it = load_report_map_
|
1889
|
+
.emplace(std::make_pair(std::move(key), LoadReportState()))
|
1890
|
+
.first;
|
1891
|
+
auto cluster_locality_stats = MakeRefCounted<XdsClusterLocalityStats>(
|
1892
|
+
Ref(DEBUG_LOCATION, "LocalityStats"), lrs_server,
|
1893
|
+
it->first.first /*cluster_name*/, it->first.second /*eds_service_name*/,
|
1894
|
+
locality);
|
1895
|
+
it->second.locality_stats[std::move(locality)].insert(
|
1896
|
+
cluster_locality_stats.get());
|
1897
|
+
chand_->MaybeStartLrsCall();
|
1898
|
+
return cluster_locality_stats;
|
1609
1899
|
}
|
1610
1900
|
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1901
|
+
void XdsClient::RemoveClusterLocalityStats(
|
1902
|
+
StringView /*lrs_server*/, StringView cluster_name,
|
1903
|
+
StringView eds_service_name, const RefCountedPtr<XdsLocalityName>& locality,
|
1904
|
+
XdsClusterLocalityStats* cluster_locality_stats) {
|
1905
|
+
auto load_report_it = load_report_map_.find(
|
1906
|
+
std::make_pair(std::string(cluster_name), std::string(eds_service_name)));
|
1907
|
+
if (load_report_it == load_report_map_.end()) return;
|
1908
|
+
LoadReportState& load_report_state = load_report_it->second;
|
1909
|
+
// TODO(roth): When we add support for direct federation, use the
|
1910
|
+
// server name specified in lrs_server.
|
1911
|
+
// TODO(roth): In principle, we should try to send a final load report
|
1912
|
+
// containing whatever final stats have been accumulated since the
|
1913
|
+
// last load report.
|
1914
|
+
auto locality_it = load_report_state.locality_stats.find(locality);
|
1915
|
+
if (locality_it == load_report_state.locality_stats.end()) return;
|
1916
|
+
auto& locality_set = locality_it->second;
|
1917
|
+
auto it = locality_set.find(cluster_locality_stats);
|
1918
|
+
if (it != locality_set.end()) {
|
1919
|
+
locality_set.erase(it);
|
1920
|
+
if (locality_set.empty()) {
|
1921
|
+
load_report_state.locality_stats.erase(locality_it);
|
1922
|
+
if (load_report_state.locality_stats.empty() &&
|
1923
|
+
load_report_state.drop_stats.empty()) {
|
1924
|
+
load_report_map_.erase(load_report_it);
|
1925
|
+
if (chand_ != nullptr && load_report_map_.empty()) {
|
1926
|
+
chand_->StopLrsCall();
|
1927
|
+
}
|
1928
|
+
}
|
1929
|
+
}
|
1619
1930
|
}
|
1620
|
-
return cluster_names;
|
1621
1931
|
}
|
1622
1932
|
|
1623
|
-
|
1624
|
-
|
1625
|
-
|
1626
|
-
const StringView& eds_service_name = p.first;
|
1627
|
-
eds_service_names.emplace(eds_service_name);
|
1933
|
+
void XdsClient::ResetBackoff() {
|
1934
|
+
if (chand_ != nullptr) {
|
1935
|
+
grpc_channel_reset_connect_backoff(chand_->channel());
|
1628
1936
|
}
|
1629
|
-
return eds_service_names;
|
1630
1937
|
}
|
1631
1938
|
|
1632
|
-
|
1633
|
-
const
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
1637
|
-
|
1638
|
-
|
1639
|
-
|
1939
|
+
grpc_error* XdsClient::CreateServiceConfig(
|
1940
|
+
const std::string& cluster_name,
|
1941
|
+
RefCountedPtr<ServiceConfig>* service_config) const {
|
1942
|
+
char* json;
|
1943
|
+
gpr_asprintf(&json,
|
1944
|
+
"{\n"
|
1945
|
+
" \"loadBalancingConfig\":[\n"
|
1946
|
+
" { \"cds_experimental\":{\n"
|
1947
|
+
" \"cluster\": \"%s\"\n"
|
1948
|
+
" } }\n"
|
1949
|
+
" ]\n"
|
1950
|
+
"}",
|
1951
|
+
cluster_name.c_str());
|
1952
|
+
grpc_error* error = GRPC_ERROR_NONE;
|
1953
|
+
*service_config = ServiceConfig::Create(json, &error);
|
1954
|
+
gpr_free(json);
|
1955
|
+
return error;
|
1956
|
+
}
|
1957
|
+
|
1958
|
+
XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshot() {
|
1959
|
+
XdsApi::ClusterLoadReportMap snapshot_map;
|
1960
|
+
for (auto& p : load_report_map_) {
|
1961
|
+
const auto& cluster_key = p.first; // cluster and EDS service name
|
1962
|
+
LoadReportState& load_report = p.second;
|
1963
|
+
XdsApi::ClusterLoadReport& snapshot = snapshot_map[cluster_key];
|
1964
|
+
// Aggregate drop stats.
|
1965
|
+
for (auto& drop_stats : load_report.drop_stats) {
|
1966
|
+
for (const auto& p : drop_stats->GetSnapshotAndReset()) {
|
1967
|
+
snapshot.dropped_requests[p.first] += p.second;
|
1968
|
+
}
|
1969
|
+
}
|
1970
|
+
// Aggregate locality stats.
|
1971
|
+
for (auto& p : load_report.locality_stats) {
|
1972
|
+
XdsLocalityName* locality_name = p.first.get();
|
1973
|
+
auto& locality_stats_set = p.second;
|
1974
|
+
XdsClusterLocalityStats::Snapshot& locality_snapshot =
|
1975
|
+
snapshot.locality_stats[locality_name];
|
1976
|
+
for (auto& locality_stats : locality_stats_set) {
|
1977
|
+
locality_snapshot += locality_stats->GetSnapshotAndReset();
|
1978
|
+
}
|
1640
1979
|
}
|
1980
|
+
// Compute load report interval.
|
1981
|
+
const grpc_millis now = ExecCtx::Get()->Now();
|
1982
|
+
snapshot.load_report_interval = now - load_report.last_report_time;
|
1983
|
+
load_report.last_report_time = now;
|
1641
1984
|
}
|
1642
|
-
return
|
1985
|
+
return snapshot_map;
|
1643
1986
|
}
|
1644
1987
|
|
1645
1988
|
void XdsClient::NotifyOnError(grpc_error* error) {
|
@@ -1661,41 +2004,15 @@ void XdsClient::NotifyOnError(grpc_error* error) {
|
|
1661
2004
|
GRPC_ERROR_UNREF(error);
|
1662
2005
|
}
|
1663
2006
|
|
1664
|
-
void XdsClient::NotifyOnServiceConfig(void* arg, grpc_error* error) {
|
1665
|
-
XdsClient* self = static_cast<XdsClient*>(arg);
|
1666
|
-
// TODO(roth): When we add support for WeightedClusters, select the
|
1667
|
-
// LB policy based on that functionality.
|
1668
|
-
char* json;
|
1669
|
-
gpr_asprintf(&json,
|
1670
|
-
"{\n"
|
1671
|
-
" \"loadBalancingConfig\":[\n"
|
1672
|
-
" { \"cds_experimental\":{\n"
|
1673
|
-
" \"cluster\": \"%s\"\n"
|
1674
|
-
" } }\n"
|
1675
|
-
" ]\n"
|
1676
|
-
"}",
|
1677
|
-
self->server_name_.c_str());
|
1678
|
-
RefCountedPtr<ServiceConfig> service_config =
|
1679
|
-
ServiceConfig::Create(json, &error);
|
1680
|
-
gpr_free(json);
|
1681
|
-
if (error != GRPC_ERROR_NONE) {
|
1682
|
-
self->service_config_watcher_->OnError(error);
|
1683
|
-
} else {
|
1684
|
-
self->service_config_watcher_->OnServiceConfigChanged(
|
1685
|
-
std::move(service_config));
|
1686
|
-
}
|
1687
|
-
self->Unref();
|
1688
|
-
}
|
1689
|
-
|
1690
2007
|
void* XdsClient::ChannelArgCopy(void* p) {
|
1691
2008
|
XdsClient* xds_client = static_cast<XdsClient*>(p);
|
1692
|
-
xds_client->Ref().release();
|
2009
|
+
xds_client->Ref(DEBUG_LOCATION, "channel arg").release();
|
1693
2010
|
return p;
|
1694
2011
|
}
|
1695
2012
|
|
1696
2013
|
void XdsClient::ChannelArgDestroy(void* p) {
|
1697
2014
|
XdsClient* xds_client = static_cast<XdsClient*>(p);
|
1698
|
-
xds_client->Unref();
|
2015
|
+
xds_client->Unref(DEBUG_LOCATION, "channel arg");
|
1699
2016
|
}
|
1700
2017
|
|
1701
2018
|
int XdsClient::ChannelArgCmp(void* p, void* q) { return GPR_ICMP(p, q); }
|