grpc 1.33.0.pre1 → 1.34.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +342 -134
- data/include/grpc/grpc.h +1 -2
- data/include/grpc/grpc_security.h +149 -172
- data/include/grpc/impl/codegen/grpc_types.h +9 -2
- data/include/grpc/impl/codegen/port_platform.h +22 -55
- data/src/core/ext/filters/client_channel/client_channel.cc +11 -34
- data/src/core/ext/filters/client_channel/config_selector.h +2 -3
- data/src/core/ext/filters/client_channel/health/health_check_client.cc +4 -1
- data/src/core/ext/filters/client_channel/health/health_check_client.h +2 -2
- data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy.cc +5 -1
- data/src/core/ext/filters/client_channel/lb_policy.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +80 -71
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +3 -1
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +2 -2
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +47 -17
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +2 -2
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +8 -5
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/xds/eds.cc +16 -243
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds.h +53 -17
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +809 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +20 -25
- data/src/core/ext/filters/client_channel/resolver.cc +3 -1
- data/src/core/ext/filters/client_channel/resolver.h +4 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.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/native/dns_resolver.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +1 -1
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +20 -0
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +66 -7
- data/src/core/ext/filters/client_channel/resolver_registry.cc +4 -4
- data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +13 -25
- data/src/core/ext/filters/client_channel/resolving_lb_policy.cc +1 -1
- data/src/core/ext/filters/client_channel/resolving_lb_policy.h +2 -2
- data/src/core/ext/filters/client_channel/retry_throttle.h +1 -1
- data/src/core/ext/filters/client_channel/server_address.h +0 -4
- data/src/core/ext/filters/client_channel/service_config.cc +3 -1
- data/src/core/ext/filters/client_channel/service_config.h +1 -1
- data/src/core/ext/filters/client_channel/subchannel.cc +18 -15
- data/src/core/ext/filters/client_channel/subchannel.h +2 -2
- data/src/core/ext/filters/client_channel/subchannel_interface.h +7 -15
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.h +6 -2
- data/src/core/ext/filters/deadline/deadline_filter.cc +83 -77
- data/src/core/ext/filters/deadline/deadline_filter.h +7 -11
- data/src/core/ext/filters/http/client/http_client_filter.cc +1 -1
- data/src/core/ext/filters/http/server/http_server_filter.cc +3 -3
- data/src/core/ext/filters/max_age/max_age_filter.cc +1 -1
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +1 -1
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +17 -3
- data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +7 -7
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +4 -24
- data/src/core/ext/transport/chttp2/transport/flow_control.h +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +2 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +12 -8
- data/src/core/ext/transport/chttp2/transport/internal.h +0 -1
- data/src/core/ext/transport/chttp2/transport/parsing.cc +2 -1
- data/src/core/ext/transport/chttp2/transport/writing.cc +1 -2
- data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c +38 -0
- data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c +41 -0
- data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +254 -0
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h +105 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c +100 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +558 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +145 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c +53 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +133 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c +127 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h +65 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c +56 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +266 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +125 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +143 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c +56 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c +66 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c +263 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h +100 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +233 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h +70 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c +56 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +228 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h +80 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c +46 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c +59 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c +55 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c +110 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +113 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c +146 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c +50 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +190 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +185 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h +65 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c +62 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +97 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +915 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +280 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c +71 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c +64 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +511 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +115 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c +48 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +166 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +105 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +249 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h +60 -0
- data/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c +72 -0
- data/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c +60 -0
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +152 -0
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h +60 -0
- data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c +83 -0
- data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c +82 -0
- data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c +83 -0
- data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c +86 -0
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c +74 -0
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c +64 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c +54 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c +53 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +73 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c +72 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c +81 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c +92 -0
- data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h +65 -0
- data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c +95 -0
- data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c +34 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c +59 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c +54 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c +47 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c +40 -0
- data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c +61 -0
- data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c +38 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +386 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h +165 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c +39 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c +37 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c +65 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c +39 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c +66 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h +75 -0
- data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c +42 -0
- data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c +70 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c +56 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c +33 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c +49 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c +43 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/authority.upbdefs.c +42 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/authority.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/collection_entry.upbdefs.c +62 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/collection_entry.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/context_params.upbdefs.c +45 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/context_params.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource.upbdefs.c +49 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_locator.upbdefs.c +68 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_locator.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_name.upbdefs.c +51 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_name.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +307 -0
- data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.h +145 -0
- data/src/core/ext/xds/certificate_provider_factory.h +7 -5
- data/src/core/ext/xds/certificate_provider_store.cc +84 -0
- data/src/core/ext/xds/certificate_provider_store.h +65 -8
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +119 -0
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +72 -0
- data/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.cc +28 -140
- data/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.h +6 -4
- data/src/core/ext/xds/xds_api.cc +241 -718
- data/src/core/ext/xds/xds_api.h +50 -9
- data/src/core/ext/xds/xds_bootstrap.cc +172 -25
- data/src/core/ext/xds/xds_bootstrap.h +23 -7
- data/src/core/ext/xds/xds_certificate_provider.cc +240 -0
- data/src/core/ext/xds/xds_certificate_provider.h +74 -0
- data/src/core/ext/xds/xds_client.cc +161 -128
- data/src/core/ext/xds/xds_client.h +12 -11
- data/src/core/ext/xds/xds_client_stats.cc +41 -4
- data/src/core/ext/xds/xds_client_stats.h +2 -2
- data/src/core/lib/channel/channel_args.cc +2 -1
- data/src/core/lib/channel/channel_trace.cc +4 -2
- data/src/core/lib/channel/channelz.h +2 -2
- data/src/core/lib/channel/handshaker.h +2 -2
- data/src/core/lib/compression/compression.cc +8 -4
- data/src/core/lib/compression/compression_internal.cc +10 -5
- data/src/core/lib/compression/compression_internal.h +2 -1
- data/src/core/lib/compression/stream_compression_identity.cc +1 -3
- data/src/core/lib/debug/stats_data.cc +1 -0
- data/src/core/lib/gpr/cpu_iphone.cc +10 -2
- data/src/core/lib/gpr/log_linux.cc +17 -3
- data/src/core/lib/gpr/log_posix.cc +13 -1
- data/src/core/lib/gpr/log_windows.cc +16 -4
- data/src/core/lib/gpr/murmur_hash.cc +1 -1
- data/src/core/lib/gpr/string.cc +1 -1
- data/src/core/lib/gpr/time_precise.cc +3 -2
- data/src/core/lib/gpr/tls.h +4 -0
- data/src/core/lib/gpr/tls_msvc.h +2 -0
- data/src/core/lib/gpr/tls_stdcpp.h +48 -0
- data/src/core/lib/gpr/useful.h +5 -4
- data/src/core/lib/gprpp/dual_ref_counted.h +44 -49
- data/src/core/lib/gprpp/examine_stack.cc +43 -0
- data/src/core/lib/gprpp/examine_stack.h +46 -0
- data/src/core/lib/gprpp/fork.cc +2 -2
- data/src/core/lib/gprpp/manual_constructor.h +1 -1
- data/src/core/lib/gprpp/orphanable.h +4 -8
- data/src/core/lib/gprpp/ref_counted.h +40 -46
- data/src/core/lib/gprpp/ref_counted_ptr.h +9 -11
- data/src/core/lib/{security/authorization/mock_cel/statusor.h → gprpp/stat.h} +13 -25
- data/src/core/lib/gprpp/stat_posix.cc +49 -0
- data/src/core/lib/gprpp/stat_windows.cc +48 -0
- data/src/core/lib/gprpp/thd.h +2 -2
- data/src/core/lib/gprpp/thd_posix.cc +36 -36
- data/src/core/lib/http/parser.cc +46 -25
- data/src/core/lib/iomgr/error.cc +2 -1
- data/src/core/lib/iomgr/ev_epollex_linux.cc +8 -4
- data/src/core/lib/iomgr/exec_ctx.cc +1 -1
- data/src/core/lib/iomgr/executor/mpmcqueue.h +5 -5
- data/src/core/lib/iomgr/executor/threadpool.h +3 -3
- data/src/core/lib/iomgr/parse_address.cc +84 -6
- data/src/core/lib/iomgr/parse_address.h +20 -0
- data/src/core/lib/iomgr/poller/eventmanager_libuv.cc +2 -1
- data/src/core/lib/iomgr/python_util.h +3 -3
- data/src/core/lib/iomgr/resolve_address_posix.cc +1 -5
- data/src/core/lib/iomgr/tcp_posix.cc +3 -2
- data/src/core/lib/iomgr/timer_custom.cc +2 -2
- data/src/core/lib/iomgr/unix_sockets_posix.cc +27 -15
- data/src/core/lib/iomgr/unix_sockets_posix.h +5 -0
- data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +7 -0
- data/src/core/lib/iomgr/wakeup_fd_pipe.cc +2 -2
- data/src/core/lib/json/json.h +2 -2
- data/src/core/lib/json/json_reader.cc +8 -4
- data/src/core/lib/json/json_util.h +167 -0
- data/src/core/lib/json/json_writer.cc +2 -1
- data/src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h +3 -1
- data/src/core/lib/security/authorization/mock_cel/cel_expression.h +5 -4
- data/src/core/lib/security/authorization/mock_cel/cel_value.h +4 -0
- data/src/core/lib/security/authorization/mock_cel/evaluator_core.h +6 -6
- data/src/core/lib/security/authorization/mock_cel/flat_expr_builder.h +10 -9
- data/src/core/lib/security/context/security_context.h +3 -1
- data/src/core/lib/security/credentials/credentials.cc +1 -1
- data/src/core/lib/security/credentials/credentials.h +3 -3
- data/src/core/lib/security/credentials/external/aws_request_signer.cc +208 -0
- data/src/core/lib/security/credentials/external/aws_request_signer.h +73 -0
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +311 -0
- data/src/core/lib/security/credentials/external/external_account_credentials.h +118 -0
- data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +136 -0
- data/src/core/lib/security/credentials/external/file_external_account_credentials.h +49 -0
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +211 -0
- data/src/core/lib/security/credentials/external/url_external_account_credentials.h +59 -0
- data/src/core/lib/security/credentials/insecure/insecure_credentials.cc +51 -0
- data/src/core/lib/security/credentials/jwt/json_token.cc +5 -2
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +4 -3
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +5 -1
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +2 -2
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc +35 -5
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +12 -8
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +78 -0
- data/src/core/lib/security/{certificate_provider.h → credentials/tls/grpc_tls_certificate_provider.h} +32 -18
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +77 -149
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +58 -187
- data/src/core/lib/security/credentials/tls/tls_credentials.cc +16 -12
- data/src/core/lib/security/credentials/tls/tls_credentials.h +2 -2
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +2 -2
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +88 -0
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +70 -0
- data/src/core/lib/security/security_connector/load_system_roots.h +4 -0
- data/src/core/lib/security/security_connector/load_system_roots_linux.h +2 -0
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +2 -2
- data/src/core/lib/security/security_connector/security_connector.cc +1 -1
- data/src/core/lib/security/security_connector/security_connector.h +4 -2
- data/src/core/lib/security/security_connector/ssl_utils.h +4 -2
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +293 -275
- data/src/core/lib/security/security_connector/tls/tls_security_connector.h +106 -61
- data/src/core/lib/security/transport/security_handshaker.cc +1 -1
- data/src/core/lib/security/transport/server_auth_filter.cc +2 -1
- data/src/core/lib/security/util/json_util.h +1 -0
- data/src/core/lib/slice/slice.cc +7 -4
- data/src/core/lib/slice/slice_buffer.cc +2 -1
- data/src/core/lib/slice/slice_intern.cc +2 -2
- data/src/core/lib/surface/call.cc +9 -8
- data/src/core/lib/surface/completion_queue.cc +7 -6
- data/src/core/lib/surface/server.cc +4 -2
- data/src/core/lib/surface/server.h +2 -2
- data/src/core/lib/surface/validate_metadata.h +3 -0
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/authority_override.h +2 -0
- data/src/core/lib/transport/bdp_estimator.cc +1 -1
- data/src/core/lib/transport/byte_stream.h +3 -3
- data/src/core/lib/transport/connectivity_state.h +3 -3
- data/src/core/lib/transport/metadata.h +2 -2
- data/src/core/lib/transport/timeout_encoding.cc +4 -4
- data/src/core/lib/transport/transport.cc +5 -3
- data/src/core/lib/transport/transport.h +1 -1
- data/src/core/plugin_registry/grpc_plugin_registry.cc +4 -4
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +4 -3
- data/src/core/tsi/fake_transport_security.cc +1 -0
- data/src/core/tsi/local_transport_security.cc +5 -1
- data/src/core/tsi/local_transport_security.h +6 -7
- data/src/core/tsi/ssl/session_cache/ssl_session.h +3 -0
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +4 -1
- data/src/core/tsi/ssl_transport_security.cc +14 -7
- data/src/core/tsi/ssl_transport_security.h +3 -0
- data/src/core/tsi/transport_security.cc +4 -2
- data/src/ruby/ext/grpc/extconf.rb +1 -1
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +22 -14
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +36 -24
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/third_party/abseil-cpp/absl/algorithm/container.h +59 -22
- data/third_party/abseil-cpp/absl/base/attributes.h +99 -38
- data/third_party/abseil-cpp/absl/base/call_once.h +1 -1
- data/third_party/abseil-cpp/absl/base/casts.h +9 -6
- data/third_party/abseil-cpp/absl/base/config.h +60 -17
- data/third_party/abseil-cpp/absl/base/dynamic_annotations.h +428 -335
- data/third_party/abseil-cpp/absl/base/internal/bits.h +17 -16
- data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +5 -0
- data/third_party/abseil-cpp/absl/base/internal/dynamic_annotations.h +398 -0
- data/third_party/abseil-cpp/absl/base/internal/invoke.h +4 -4
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +1 -1
- data/third_party/abseil-cpp/absl/base/internal/low_level_scheduling.h +29 -1
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +2 -2
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +7 -5
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +25 -38
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +19 -25
- data/third_party/abseil-cpp/absl/base/internal/spinlock_linux.inc +8 -0
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +28 -5
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.h +8 -0
- data/third_party/abseil-cpp/absl/base/internal/tsan_mutex_interface.h +3 -1
- data/third_party/abseil-cpp/absl/base/internal/unaligned_access.h +2 -2
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +3 -3
- data/third_party/abseil-cpp/absl/base/macros.h +36 -109
- data/third_party/abseil-cpp/absl/base/optimization.h +61 -1
- data/third_party/abseil-cpp/absl/base/options.h +31 -4
- data/third_party/abseil-cpp/absl/base/policy_checks.h +1 -1
- data/third_party/abseil-cpp/absl/base/thread_annotations.h +94 -39
- data/third_party/abseil-cpp/absl/container/fixed_array.h +42 -25
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +2 -1
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +33 -36
- data/third_party/abseil-cpp/absl/container/internal/common.h +6 -2
- data/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h +33 -8
- data/third_party/abseil-cpp/absl/container/internal/container_memory.h +49 -29
- data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +15 -0
- data/third_party/abseil-cpp/absl/container/internal/hash_policy_traits.h +24 -7
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +2 -1
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +35 -11
- data/third_party/abseil-cpp/absl/container/internal/have_sse.h +10 -9
- data/third_party/abseil-cpp/absl/container/internal/layout.h +7 -5
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +55 -34
- data/third_party/abseil-cpp/absl/debugging/internal/address_is_readable.cc +5 -4
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +66 -16
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +4 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc +13 -4
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h +43 -24
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc +12 -3
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_win32-inl.inc +10 -2
- data/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +22 -1
- data/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc +0 -21
- data/third_party/abseil-cpp/absl/debugging/symbolize.cc +12 -1
- data/third_party/abseil-cpp/absl/debugging/symbolize_darwin.inc +101 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +100 -20
- data/third_party/abseil-cpp/absl/functional/bind_front.h +184 -0
- data/third_party/abseil-cpp/absl/functional/function_ref.h +1 -1
- data/third_party/abseil-cpp/absl/functional/internal/front_binder.h +95 -0
- data/third_party/abseil-cpp/absl/functional/internal/function_ref.h +2 -2
- data/third_party/abseil-cpp/absl/hash/hash.h +6 -5
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +73 -65
- data/third_party/abseil-cpp/absl/memory/memory.h +4 -0
- data/third_party/abseil-cpp/absl/meta/type_traits.h +2 -8
- data/third_party/abseil-cpp/absl/numeric/int128.cc +13 -27
- data/third_party/abseil-cpp/absl/numeric/int128.h +16 -15
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +51 -0
- data/third_party/abseil-cpp/absl/status/status.cc +4 -6
- data/third_party/abseil-cpp/absl/status/status.h +502 -113
- data/third_party/abseil-cpp/absl/status/status_payload_printer.cc +5 -10
- data/third_party/abseil-cpp/absl/strings/charconv.cc +2 -2
- data/third_party/abseil-cpp/absl/strings/cord.cc +91 -112
- data/third_party/abseil-cpp/absl/strings/cord.h +360 -205
- data/third_party/abseil-cpp/absl/strings/escaping.cc +9 -9
- data/third_party/abseil-cpp/absl/strings/internal/char_map.h +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.h +2 -2
- data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +2 -2
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +45 -23
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +222 -136
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +136 -64
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +14 -21
- data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +7 -14
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +31 -7
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +147 -135
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +999 -87
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.h +3 -3
- data/third_party/abseil-cpp/absl/strings/internal/str_format/output.h +4 -12
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +8 -6
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +13 -11
- data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +2 -2
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +4 -4
- data/third_party/abseil-cpp/absl/strings/str_cat.h +1 -1
- data/third_party/abseil-cpp/absl/strings/str_format.h +289 -13
- data/third_party/abseil-cpp/absl/strings/str_split.cc +2 -2
- data/third_party/abseil-cpp/absl/strings/str_split.h +1 -0
- data/third_party/abseil-cpp/absl/strings/string_view.h +26 -19
- data/third_party/abseil-cpp/absl/strings/substitute.cc +5 -5
- data/third_party/abseil-cpp/absl/strings/substitute.h +32 -29
- data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc +3 -3
- data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +3 -3
- data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +28 -28
- data/third_party/abseil-cpp/absl/synchronization/internal/mutex_nonprod.inc +4 -16
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +1 -1
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc +8 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.h +2 -2
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +75 -64
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +15 -6
- data/third_party/abseil-cpp/absl/time/civil_time.cc +9 -9
- data/third_party/abseil-cpp/absl/time/clock.cc +3 -3
- data/third_party/abseil-cpp/absl/time/duration.cc +90 -59
- data/third_party/abseil-cpp/absl/time/format.cc +43 -36
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h +26 -16
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +4 -2
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/zone_info_source.h +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc +136 -29
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.cc +13 -21
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.h +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc +136 -129
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.h +4 -5
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc +8 -7
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +6 -6
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc +2 -1
- data/third_party/abseil-cpp/absl/time/time.h +15 -16
- data/third_party/abseil-cpp/absl/types/internal/variant.h +4 -4
- data/third_party/abseil-cpp/absl/types/optional.h +9 -9
- data/third_party/abseil-cpp/absl/types/span.h +49 -36
- data/third_party/abseil-cpp/absl/utility/utility.h +2 -2
- data/third_party/address_sorting/include/address_sorting/address_sorting.h +2 -0
- data/third_party/boringssl-with-bazel/err_data.c +340 -336
- data/third_party/boringssl-with-bazel/src/crypto/bio/bio.c +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/e_aes.c +173 -35
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa_impl.c +46 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +8 -2
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/internal.h +90 -63
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/pmbtoken.c +60 -60
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/trust_token.c +179 -47
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/voprf.c +766 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/algorithm.c +10 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_data.c +5 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c +14 -14
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_prn.c +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/aead.h +24 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/arm_arch.h +7 -5
- data/third_party/boringssl-with-bazel/src/include/openssl/base.h +5 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/bio.h +4 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/des.h +6 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/opensslconf.h +3 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/pem.h +202 -134
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +55 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/tls1.h +4 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/trust_token.h +31 -23
- data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +435 -394
- data/third_party/boringssl-with-bazel/src/ssl/bio_ssl.cc +18 -5
- data/third_party/boringssl-with-bazel/src/ssl/handoff.cc +35 -0
- data/third_party/boringssl-with-bazel/src/ssl/internal.h +36 -1
- data/third_party/boringssl-with-bazel/src/ssl/ssl_asn1.cc +42 -1
- data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +67 -0
- data/third_party/boringssl-with-bazel/src/ssl/ssl_session.cc +11 -14
- data/third_party/boringssl-with-bazel/src/ssl/t1_lib.cc +216 -11
- data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +53 -11
- data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +133 -39
- data/third_party/upb/upb/def.c +2169 -0
- data/third_party/upb/upb/def.h +330 -0
- data/third_party/upb/upb/def.hpp +525 -0
- data/third_party/upb/upb/reflection.c +391 -0
- data/third_party/upb/upb/reflection.h +168 -0
- data/third_party/upb/upb/text_encode.c +398 -0
- data/third_party/upb/upb/text_encode.h +35 -0
- metadata +227 -37
- data/src/core/ext/filters/client_channel/lb_policy/xds/eds_drop.cc +0 -571
- data/third_party/abseil-cpp/absl/base/dynamic_annotations.cc +0 -129
@@ -1,26 +1,28 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
*
|
17
|
-
*/
|
1
|
+
//
|
2
|
+
// Copyright 2018 gRPC authors.
|
3
|
+
//
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
// you may not use this file except in compliance with the License.
|
6
|
+
// You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
// See the License for the specific language governing permissions and
|
14
|
+
// limitations under the License.
|
15
|
+
//
|
18
16
|
|
19
17
|
#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_XDS_XDS_H
|
20
18
|
#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_XDS_XDS_H
|
21
19
|
|
22
20
|
#include <grpc/support/port_platform.h>
|
23
21
|
|
22
|
+
#include "src/core/ext/filters/client_channel/server_address.h"
|
23
|
+
#include "src/core/ext/xds/xds_client_stats.h"
|
24
|
+
#include "src/core/lib/gprpp/ref_counted_ptr.h"
|
25
|
+
|
24
26
|
/** Channel arg indicating if a target corresponding to the address is a backend
|
25
27
|
* received from a balancer. The type of this arg is an integer and the value is
|
26
28
|
* treated as a bool. */
|
@@ -29,4 +31,38 @@
|
|
29
31
|
#define GRPC_ARG_ADDRESS_IS_BACKEND_FROM_XDS_LOAD_BALANCER \
|
30
32
|
"grpc.address_is_backend_from_xds_load_balancer"
|
31
33
|
|
34
|
+
namespace grpc_core {
|
35
|
+
|
36
|
+
// Defined in the EDS policy.
|
37
|
+
extern const char* kXdsLocalityNameAttributeKey;
|
38
|
+
|
39
|
+
class XdsLocalityAttribute : public ServerAddress::AttributeInterface {
|
40
|
+
public:
|
41
|
+
explicit XdsLocalityAttribute(RefCountedPtr<XdsLocalityName> locality_name)
|
42
|
+
: locality_name_(std::move(locality_name)) {}
|
43
|
+
|
44
|
+
RefCountedPtr<XdsLocalityName> locality_name() const {
|
45
|
+
return locality_name_;
|
46
|
+
}
|
47
|
+
|
48
|
+
std::unique_ptr<AttributeInterface> Copy() const override {
|
49
|
+
return absl::make_unique<XdsLocalityAttribute>(locality_name_->Ref());
|
50
|
+
}
|
51
|
+
|
52
|
+
int Cmp(const AttributeInterface* other) const override {
|
53
|
+
const auto* other_locality_attr =
|
54
|
+
static_cast<const XdsLocalityAttribute*>(other);
|
55
|
+
return locality_name_->Compare(*other_locality_attr->locality_name_);
|
56
|
+
}
|
57
|
+
|
58
|
+
std::string ToString() const override {
|
59
|
+
return locality_name_->AsHumanReadableString();
|
60
|
+
}
|
61
|
+
|
62
|
+
private:
|
63
|
+
RefCountedPtr<XdsLocalityName> locality_name_;
|
64
|
+
};
|
65
|
+
|
66
|
+
} // namespace grpc_core
|
67
|
+
|
32
68
|
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_XDS_XDS_H */
|
@@ -0,0 +1,809 @@
|
|
1
|
+
//
|
2
|
+
// Copyright 2018 gRPC authors.
|
3
|
+
//
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
// you may not use this file except in compliance with the License.
|
6
|
+
// You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
// See the License for the specific language governing permissions and
|
14
|
+
// limitations under the License.
|
15
|
+
//
|
16
|
+
|
17
|
+
#include <grpc/support/port_platform.h>
|
18
|
+
|
19
|
+
#include "absl/strings/string_view.h"
|
20
|
+
|
21
|
+
#include <grpc/grpc.h>
|
22
|
+
|
23
|
+
#include "src/core/ext/filters/client_channel/lb_policy.h"
|
24
|
+
#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
|
25
|
+
#include "src/core/ext/filters/client_channel/lb_policy/xds/xds.h"
|
26
|
+
#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
|
27
|
+
#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
|
28
|
+
#include "src/core/ext/xds/xds_client.h"
|
29
|
+
#include "src/core/ext/xds/xds_client_stats.h"
|
30
|
+
#include "src/core/lib/channel/channel_args.h"
|
31
|
+
#include "src/core/lib/gpr/env.h"
|
32
|
+
#include "src/core/lib/gpr/string.h"
|
33
|
+
#include "src/core/lib/gprpp/orphanable.h"
|
34
|
+
#include "src/core/lib/gprpp/ref_counted_ptr.h"
|
35
|
+
#include "src/core/lib/gprpp/sync.h"
|
36
|
+
#include "src/core/lib/iomgr/work_serializer.h"
|
37
|
+
|
38
|
+
namespace grpc_core {
|
39
|
+
|
40
|
+
TraceFlag grpc_xds_cluster_impl_lb_trace(false, "xds_cluster_impl_lb");
|
41
|
+
|
42
|
+
namespace {
|
43
|
+
|
44
|
+
//
|
45
|
+
// global circuit breaker atomic map
|
46
|
+
//
|
47
|
+
|
48
|
+
class CircuitBreakerCallCounterMap {
|
49
|
+
public:
|
50
|
+
using Key =
|
51
|
+
std::pair<std::string /*cluster*/, std::string /*eds_service_name*/>;
|
52
|
+
|
53
|
+
class CallCounter : public RefCounted<CallCounter> {
|
54
|
+
public:
|
55
|
+
explicit CallCounter(Key key) : key_(std::move(key)) {}
|
56
|
+
~CallCounter() override;
|
57
|
+
|
58
|
+
uint32_t Increment() { return concurrent_requests_.FetchAdd(1); }
|
59
|
+
void Decrement() { concurrent_requests_.FetchSub(1); }
|
60
|
+
|
61
|
+
private:
|
62
|
+
Key key_;
|
63
|
+
Atomic<uint32_t> concurrent_requests_{0};
|
64
|
+
};
|
65
|
+
|
66
|
+
RefCountedPtr<CallCounter> GetOrCreate(const std::string& cluster,
|
67
|
+
const std::string& eds_service_name);
|
68
|
+
|
69
|
+
private:
|
70
|
+
Mutex mu_;
|
71
|
+
std::map<Key, CallCounter*> map_;
|
72
|
+
};
|
73
|
+
|
74
|
+
CircuitBreakerCallCounterMap* g_call_counter_map = nullptr;
|
75
|
+
|
76
|
+
RefCountedPtr<CircuitBreakerCallCounterMap::CallCounter>
|
77
|
+
CircuitBreakerCallCounterMap::GetOrCreate(const std::string& cluster,
|
78
|
+
const std::string& eds_service_name) {
|
79
|
+
Key key(cluster, eds_service_name);
|
80
|
+
RefCountedPtr<CallCounter> result;
|
81
|
+
MutexLock lock(&mu_);
|
82
|
+
auto it = map_.find(key);
|
83
|
+
if (it == map_.end()) {
|
84
|
+
it = map_.insert({key, nullptr}).first;
|
85
|
+
} else {
|
86
|
+
result = it->second->RefIfNonZero();
|
87
|
+
}
|
88
|
+
if (result == nullptr) {
|
89
|
+
result = MakeRefCounted<CallCounter>(std::move(key));
|
90
|
+
it->second = result.get();
|
91
|
+
}
|
92
|
+
return result;
|
93
|
+
}
|
94
|
+
|
95
|
+
CircuitBreakerCallCounterMap::CallCounter::~CallCounter() {
|
96
|
+
MutexLock lock(&g_call_counter_map->mu_);
|
97
|
+
auto it = g_call_counter_map->map_.find(key_);
|
98
|
+
if (it != g_call_counter_map->map_.end() && it->second == this) {
|
99
|
+
g_call_counter_map->map_.erase(it);
|
100
|
+
}
|
101
|
+
}
|
102
|
+
|
103
|
+
//
|
104
|
+
// LB policy
|
105
|
+
//
|
106
|
+
|
107
|
+
constexpr char kXdsClusterImpl[] = "xds_cluster_impl_experimental";
|
108
|
+
|
109
|
+
// TODO (donnadionne): Check to see if circuit breaking is enabled, this will be
|
110
|
+
// removed once circuit breaking feature is fully integrated and enabled by
|
111
|
+
// default.
|
112
|
+
bool XdsCircuitBreakingEnabled() {
|
113
|
+
char* value = gpr_getenv("GRPC_XDS_EXPERIMENTAL_CIRCUIT_BREAKING");
|
114
|
+
bool parsed_value;
|
115
|
+
bool parse_succeeded = gpr_parse_bool_value(value, &parsed_value);
|
116
|
+
gpr_free(value);
|
117
|
+
return parse_succeeded && parsed_value;
|
118
|
+
}
|
119
|
+
|
120
|
+
// Config for xDS Cluster Impl LB policy.
|
121
|
+
class XdsClusterImplLbConfig : public LoadBalancingPolicy::Config {
|
122
|
+
public:
|
123
|
+
XdsClusterImplLbConfig(
|
124
|
+
RefCountedPtr<LoadBalancingPolicy::Config> child_policy,
|
125
|
+
std::string cluster_name, std::string eds_service_name,
|
126
|
+
absl::optional<std::string> lrs_load_reporting_server_name,
|
127
|
+
uint32_t max_concurrent_requests,
|
128
|
+
RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config)
|
129
|
+
: child_policy_(std::move(child_policy)),
|
130
|
+
cluster_name_(std::move(cluster_name)),
|
131
|
+
eds_service_name_(std::move(eds_service_name)),
|
132
|
+
lrs_load_reporting_server_name_(
|
133
|
+
std::move(lrs_load_reporting_server_name)),
|
134
|
+
max_concurrent_requests_(max_concurrent_requests),
|
135
|
+
drop_config_(std::move(drop_config)) {}
|
136
|
+
|
137
|
+
const char* name() const override { return kXdsClusterImpl; }
|
138
|
+
|
139
|
+
RefCountedPtr<LoadBalancingPolicy::Config> child_policy() const {
|
140
|
+
return child_policy_;
|
141
|
+
}
|
142
|
+
const std::string& cluster_name() const { return cluster_name_; }
|
143
|
+
const std::string& eds_service_name() const { return eds_service_name_; }
|
144
|
+
const absl::optional<std::string>& lrs_load_reporting_server_name() const {
|
145
|
+
return lrs_load_reporting_server_name_;
|
146
|
+
};
|
147
|
+
const uint32_t max_concurrent_requests() const {
|
148
|
+
return max_concurrent_requests_;
|
149
|
+
}
|
150
|
+
RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config() const {
|
151
|
+
return drop_config_;
|
152
|
+
}
|
153
|
+
|
154
|
+
private:
|
155
|
+
RefCountedPtr<LoadBalancingPolicy::Config> child_policy_;
|
156
|
+
std::string cluster_name_;
|
157
|
+
std::string eds_service_name_;
|
158
|
+
absl::optional<std::string> lrs_load_reporting_server_name_;
|
159
|
+
uint32_t max_concurrent_requests_;
|
160
|
+
RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config_;
|
161
|
+
};
|
162
|
+
|
163
|
+
// xDS Cluster Impl LB policy.
|
164
|
+
class XdsClusterImplLb : public LoadBalancingPolicy {
|
165
|
+
public:
|
166
|
+
XdsClusterImplLb(RefCountedPtr<XdsClient> xds_client, Args args);
|
167
|
+
|
168
|
+
const char* name() const override { return kXdsClusterImpl; }
|
169
|
+
|
170
|
+
void UpdateLocked(UpdateArgs args) override;
|
171
|
+
void ExitIdleLocked() override;
|
172
|
+
void ResetBackoffLocked() override;
|
173
|
+
|
174
|
+
private:
|
175
|
+
class StatsSubchannelWrapper : public DelegatingSubchannel {
|
176
|
+
public:
|
177
|
+
StatsSubchannelWrapper(
|
178
|
+
RefCountedPtr<SubchannelInterface> wrapped_subchannel,
|
179
|
+
RefCountedPtr<XdsClusterLocalityStats> locality_stats)
|
180
|
+
: DelegatingSubchannel(std::move(wrapped_subchannel)),
|
181
|
+
locality_stats_(std::move(locality_stats)) {}
|
182
|
+
|
183
|
+
XdsClusterLocalityStats* locality_stats() const {
|
184
|
+
return locality_stats_.get();
|
185
|
+
}
|
186
|
+
|
187
|
+
private:
|
188
|
+
RefCountedPtr<XdsClusterLocalityStats> locality_stats_;
|
189
|
+
};
|
190
|
+
|
191
|
+
// A simple wrapper for ref-counting a picker from the child policy.
|
192
|
+
class RefCountedPicker : public RefCounted<RefCountedPicker> {
|
193
|
+
public:
|
194
|
+
explicit RefCountedPicker(std::unique_ptr<SubchannelPicker> picker)
|
195
|
+
: picker_(std::move(picker)) {}
|
196
|
+
PickResult Pick(PickArgs args) { return picker_->Pick(args); }
|
197
|
+
|
198
|
+
private:
|
199
|
+
std::unique_ptr<SubchannelPicker> picker_;
|
200
|
+
};
|
201
|
+
|
202
|
+
// A picker that wraps the picker from the child to perform drops.
|
203
|
+
class Picker : public SubchannelPicker {
|
204
|
+
public:
|
205
|
+
Picker(XdsClusterImplLb* xds_cluster_impl_lb,
|
206
|
+
RefCountedPtr<RefCountedPicker> picker);
|
207
|
+
|
208
|
+
PickResult Pick(PickArgs args) override;
|
209
|
+
|
210
|
+
private:
|
211
|
+
RefCountedPtr<CircuitBreakerCallCounterMap::CallCounter> call_counter_;
|
212
|
+
bool xds_circuit_breaking_enabled_;
|
213
|
+
uint32_t max_concurrent_requests_;
|
214
|
+
RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config_;
|
215
|
+
RefCountedPtr<XdsClusterDropStats> drop_stats_;
|
216
|
+
RefCountedPtr<RefCountedPicker> picker_;
|
217
|
+
};
|
218
|
+
|
219
|
+
class Helper : public ChannelControlHelper {
|
220
|
+
public:
|
221
|
+
explicit Helper(RefCountedPtr<XdsClusterImplLb> xds_cluster_impl_policy)
|
222
|
+
: xds_cluster_impl_policy_(std::move(xds_cluster_impl_policy)) {}
|
223
|
+
|
224
|
+
~Helper() override {
|
225
|
+
xds_cluster_impl_policy_.reset(DEBUG_LOCATION, "Helper");
|
226
|
+
}
|
227
|
+
|
228
|
+
RefCountedPtr<SubchannelInterface> CreateSubchannel(
|
229
|
+
ServerAddress address, const grpc_channel_args& args) override;
|
230
|
+
void UpdateState(grpc_connectivity_state state, const absl::Status& status,
|
231
|
+
std::unique_ptr<SubchannelPicker> picker) override;
|
232
|
+
void RequestReresolution() override;
|
233
|
+
void AddTraceEvent(TraceSeverity severity,
|
234
|
+
absl::string_view message) override;
|
235
|
+
|
236
|
+
private:
|
237
|
+
RefCountedPtr<XdsClusterImplLb> xds_cluster_impl_policy_;
|
238
|
+
};
|
239
|
+
|
240
|
+
~XdsClusterImplLb() override;
|
241
|
+
|
242
|
+
void ShutdownLocked() override;
|
243
|
+
|
244
|
+
OrphanablePtr<LoadBalancingPolicy> CreateChildPolicyLocked(
|
245
|
+
const grpc_channel_args* args);
|
246
|
+
void UpdateChildPolicyLocked(ServerAddressList addresses,
|
247
|
+
const grpc_channel_args* args);
|
248
|
+
|
249
|
+
void MaybeUpdatePickerLocked();
|
250
|
+
|
251
|
+
// Current config from the resolver.
|
252
|
+
RefCountedPtr<XdsClusterImplLbConfig> config_;
|
253
|
+
|
254
|
+
// Current concurrent number of requests.
|
255
|
+
RefCountedPtr<CircuitBreakerCallCounterMap::CallCounter> call_counter_;
|
256
|
+
|
257
|
+
// Internal state.
|
258
|
+
bool shutting_down_ = false;
|
259
|
+
|
260
|
+
// The xds client.
|
261
|
+
RefCountedPtr<XdsClient> xds_client_;
|
262
|
+
|
263
|
+
// The stats for client-side load reporting.
|
264
|
+
RefCountedPtr<XdsClusterDropStats> drop_stats_;
|
265
|
+
|
266
|
+
OrphanablePtr<LoadBalancingPolicy> child_policy_;
|
267
|
+
|
268
|
+
// Latest state and picker reported by the child policy.
|
269
|
+
grpc_connectivity_state state_ = GRPC_CHANNEL_IDLE;
|
270
|
+
absl::Status status_;
|
271
|
+
RefCountedPtr<RefCountedPicker> picker_;
|
272
|
+
};
|
273
|
+
|
274
|
+
//
|
275
|
+
// XdsClusterImplLb::Picker
|
276
|
+
//
|
277
|
+
|
278
|
+
XdsClusterImplLb::Picker::Picker(XdsClusterImplLb* xds_cluster_impl_lb,
|
279
|
+
RefCountedPtr<RefCountedPicker> picker)
|
280
|
+
: call_counter_(xds_cluster_impl_lb->call_counter_),
|
281
|
+
xds_circuit_breaking_enabled_(XdsCircuitBreakingEnabled()),
|
282
|
+
max_concurrent_requests_(
|
283
|
+
xds_cluster_impl_lb->config_->max_concurrent_requests()),
|
284
|
+
drop_config_(xds_cluster_impl_lb->config_->drop_config()),
|
285
|
+
drop_stats_(xds_cluster_impl_lb->drop_stats_),
|
286
|
+
picker_(std::move(picker)) {
|
287
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) {
|
288
|
+
gpr_log(GPR_INFO, "[xds_cluster_impl_lb %p] constructed new picker %p",
|
289
|
+
xds_cluster_impl_lb, this);
|
290
|
+
}
|
291
|
+
}
|
292
|
+
|
293
|
+
LoadBalancingPolicy::PickResult XdsClusterImplLb::Picker::Pick(
|
294
|
+
LoadBalancingPolicy::PickArgs args) {
|
295
|
+
// Handle EDS drops.
|
296
|
+
const std::string* drop_category;
|
297
|
+
if (drop_config_->ShouldDrop(&drop_category)) {
|
298
|
+
if (drop_stats_ != nullptr) drop_stats_->AddCallDropped(*drop_category);
|
299
|
+
PickResult result;
|
300
|
+
result.type = PickResult::PICK_COMPLETE;
|
301
|
+
return result;
|
302
|
+
}
|
303
|
+
// Handle circuit breaking.
|
304
|
+
uint32_t current = call_counter_->Increment();
|
305
|
+
if (xds_circuit_breaking_enabled_) {
|
306
|
+
// Check and see if we exceeded the max concurrent requests count.
|
307
|
+
if (current >= max_concurrent_requests_) {
|
308
|
+
call_counter_->Decrement();
|
309
|
+
if (drop_stats_ != nullptr) drop_stats_->AddUncategorizedDrops();
|
310
|
+
PickResult result;
|
311
|
+
result.type = PickResult::PICK_COMPLETE;
|
312
|
+
return result;
|
313
|
+
}
|
314
|
+
}
|
315
|
+
// If we're not dropping the call, we should always have a child picker.
|
316
|
+
if (picker_ == nullptr) { // Should never happen.
|
317
|
+
PickResult result;
|
318
|
+
result.type = PickResult::PICK_FAILED;
|
319
|
+
result.error = grpc_error_set_int(
|
320
|
+
GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
321
|
+
"xds_cluster_impl picker not given any child picker"),
|
322
|
+
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_INTERNAL);
|
323
|
+
call_counter_->Decrement();
|
324
|
+
return result;
|
325
|
+
}
|
326
|
+
// Not dropping, so delegate to child picker.
|
327
|
+
PickResult result = picker_->Pick(args);
|
328
|
+
if (result.type == result.PICK_COMPLETE && result.subchannel != nullptr) {
|
329
|
+
XdsClusterLocalityStats* locality_stats = nullptr;
|
330
|
+
if (drop_stats_ != nullptr) { // If load reporting is enabled.
|
331
|
+
auto* subchannel_wrapper =
|
332
|
+
static_cast<StatsSubchannelWrapper*>(result.subchannel.get());
|
333
|
+
// Handle load reporting.
|
334
|
+
locality_stats = subchannel_wrapper->locality_stats()->Ref().release();
|
335
|
+
// Record a call started.
|
336
|
+
locality_stats->AddCallStarted();
|
337
|
+
// Unwrap subchannel to pass back up the stack.
|
338
|
+
result.subchannel = subchannel_wrapper->wrapped_subchannel();
|
339
|
+
}
|
340
|
+
// Intercept the recv_trailing_metadata op to record call completion.
|
341
|
+
auto* call_counter = call_counter_->Ref(DEBUG_LOCATION, "call").release();
|
342
|
+
auto original_recv_trailing_metadata_ready =
|
343
|
+
result.recv_trailing_metadata_ready;
|
344
|
+
result.recv_trailing_metadata_ready =
|
345
|
+
// Note: This callback does not run in either the control plane
|
346
|
+
// work serializer or in the data plane mutex.
|
347
|
+
[locality_stats, original_recv_trailing_metadata_ready, call_counter](
|
348
|
+
grpc_error* error, MetadataInterface* metadata,
|
349
|
+
CallState* call_state) {
|
350
|
+
// Record call completion for load reporting.
|
351
|
+
if (locality_stats != nullptr) {
|
352
|
+
const bool call_failed = error != GRPC_ERROR_NONE;
|
353
|
+
locality_stats->AddCallFinished(call_failed);
|
354
|
+
locality_stats->Unref(DEBUG_LOCATION, "LocalityStats+call");
|
355
|
+
}
|
356
|
+
// Decrement number of calls in flight.
|
357
|
+
call_counter->Decrement();
|
358
|
+
call_counter->Unref(DEBUG_LOCATION, "call");
|
359
|
+
// Invoke the original recv_trailing_metadata_ready callback, if any.
|
360
|
+
if (original_recv_trailing_metadata_ready != nullptr) {
|
361
|
+
original_recv_trailing_metadata_ready(error, metadata, call_state);
|
362
|
+
}
|
363
|
+
};
|
364
|
+
} else {
|
365
|
+
// TODO(roth): We should ideally also record call failures here in the case
|
366
|
+
// where a pick fails. This is challenging, because we don't know which
|
367
|
+
// picks are for wait_for_ready RPCs or how many times we'll return a
|
368
|
+
// failure for the same wait_for_ready RPC.
|
369
|
+
call_counter_->Decrement();
|
370
|
+
}
|
371
|
+
return result;
|
372
|
+
}
|
373
|
+
|
374
|
+
//
|
375
|
+
// XdsClusterImplLb
|
376
|
+
//
|
377
|
+
|
378
|
+
XdsClusterImplLb::XdsClusterImplLb(RefCountedPtr<XdsClient> xds_client,
|
379
|
+
Args args)
|
380
|
+
: LoadBalancingPolicy(std::move(args)), xds_client_(std::move(xds_client)) {
|
381
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) {
|
382
|
+
gpr_log(GPR_INFO, "[xds_cluster_impl_lb %p] created -- using xds client %p",
|
383
|
+
this, xds_client_.get());
|
384
|
+
}
|
385
|
+
}
|
386
|
+
|
387
|
+
XdsClusterImplLb::~XdsClusterImplLb() {
|
388
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) {
|
389
|
+
gpr_log(GPR_INFO,
|
390
|
+
"[xds_cluster_impl_lb %p] destroying xds_cluster_impl LB policy",
|
391
|
+
this);
|
392
|
+
}
|
393
|
+
}
|
394
|
+
|
395
|
+
void XdsClusterImplLb::ShutdownLocked() {
|
396
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) {
|
397
|
+
gpr_log(GPR_INFO, "[xds_cluster_impl_lb %p] shutting down", this);
|
398
|
+
}
|
399
|
+
shutting_down_ = true;
|
400
|
+
// Remove the child policy's interested_parties pollset_set from the
|
401
|
+
// xDS policy.
|
402
|
+
if (child_policy_ != nullptr) {
|
403
|
+
grpc_pollset_set_del_pollset_set(child_policy_->interested_parties(),
|
404
|
+
interested_parties());
|
405
|
+
child_policy_.reset();
|
406
|
+
}
|
407
|
+
// Drop our ref to the child's picker, in case it's holding a ref to
|
408
|
+
// the child.
|
409
|
+
picker_.reset();
|
410
|
+
drop_stats_.reset();
|
411
|
+
xds_client_.reset();
|
412
|
+
}
|
413
|
+
|
414
|
+
void XdsClusterImplLb::ExitIdleLocked() {
|
415
|
+
if (child_policy_ != nullptr) child_policy_->ExitIdleLocked();
|
416
|
+
}
|
417
|
+
|
418
|
+
void XdsClusterImplLb::ResetBackoffLocked() {
|
419
|
+
// The XdsClient will have its backoff reset by the xds resolver, so we
|
420
|
+
// don't need to do it here.
|
421
|
+
if (child_policy_ != nullptr) child_policy_->ResetBackoffLocked();
|
422
|
+
}
|
423
|
+
|
424
|
+
void XdsClusterImplLb::UpdateLocked(UpdateArgs args) {
|
425
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) {
|
426
|
+
gpr_log(GPR_INFO, "[xds_cluster_impl_lb %p] Received update", this);
|
427
|
+
}
|
428
|
+
// Update config.
|
429
|
+
const bool is_initial_update = config_ == nullptr;
|
430
|
+
auto old_config = std::move(config_);
|
431
|
+
config_ = std::move(args.config);
|
432
|
+
// On initial update, create drop stats.
|
433
|
+
if (is_initial_update) {
|
434
|
+
if (config_->lrs_load_reporting_server_name().has_value()) {
|
435
|
+
drop_stats_ = xds_client_->AddClusterDropStats(
|
436
|
+
config_->lrs_load_reporting_server_name().value(),
|
437
|
+
config_->cluster_name(), config_->eds_service_name());
|
438
|
+
}
|
439
|
+
call_counter_ = g_call_counter_map->GetOrCreate(
|
440
|
+
config_->cluster_name(), config_->eds_service_name());
|
441
|
+
} else {
|
442
|
+
// Cluster name, EDS service name, and LRS server name should never
|
443
|
+
// change, because the EDS policy above us should be swapped out if
|
444
|
+
// that happens.
|
445
|
+
GPR_ASSERT(config_->cluster_name() == old_config->cluster_name());
|
446
|
+
GPR_ASSERT(config_->eds_service_name() == old_config->eds_service_name());
|
447
|
+
GPR_ASSERT(config_->lrs_load_reporting_server_name() ==
|
448
|
+
old_config->lrs_load_reporting_server_name());
|
449
|
+
}
|
450
|
+
// Update picker if max_concurrent_requests has changed.
|
451
|
+
if (is_initial_update || config_->max_concurrent_requests() !=
|
452
|
+
old_config->max_concurrent_requests()) {
|
453
|
+
MaybeUpdatePickerLocked();
|
454
|
+
}
|
455
|
+
// Update child policy.
|
456
|
+
UpdateChildPolicyLocked(std::move(args.addresses), args.args);
|
457
|
+
args.args = nullptr;
|
458
|
+
}
|
459
|
+
|
460
|
+
void XdsClusterImplLb::MaybeUpdatePickerLocked() {
|
461
|
+
// If we're dropping all calls, report READY, regardless of what (or
|
462
|
+
// whether) the child has reported.
|
463
|
+
if (config_->drop_config() != nullptr && config_->drop_config()->drop_all()) {
|
464
|
+
auto drop_picker = absl::make_unique<Picker>(this, picker_);
|
465
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) {
|
466
|
+
gpr_log(GPR_INFO,
|
467
|
+
"[xds_cluster_impl_lb %p] updating connectivity (drop all): "
|
468
|
+
"state=READY "
|
469
|
+
"picker=%p",
|
470
|
+
this, drop_picker.get());
|
471
|
+
}
|
472
|
+
channel_control_helper()->UpdateState(GRPC_CHANNEL_READY, absl::Status(),
|
473
|
+
std::move(drop_picker));
|
474
|
+
return;
|
475
|
+
}
|
476
|
+
// Otherwise, update only if we have a child picker.
|
477
|
+
if (picker_ != nullptr) {
|
478
|
+
auto drop_picker = absl::make_unique<Picker>(this, picker_);
|
479
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) {
|
480
|
+
gpr_log(GPR_INFO,
|
481
|
+
"[xds_cluster_impl_lb %p] updating connectivity: state=%s "
|
482
|
+
"status=(%s) "
|
483
|
+
"picker=%p",
|
484
|
+
this, ConnectivityStateName(state_), status_.ToString().c_str(),
|
485
|
+
drop_picker.get());
|
486
|
+
}
|
487
|
+
channel_control_helper()->UpdateState(state_, status_,
|
488
|
+
std::move(drop_picker));
|
489
|
+
}
|
490
|
+
}
|
491
|
+
|
492
|
+
OrphanablePtr<LoadBalancingPolicy> XdsClusterImplLb::CreateChildPolicyLocked(
|
493
|
+
const grpc_channel_args* args) {
|
494
|
+
LoadBalancingPolicy::Args lb_policy_args;
|
495
|
+
lb_policy_args.work_serializer = work_serializer();
|
496
|
+
lb_policy_args.args = args;
|
497
|
+
lb_policy_args.channel_control_helper =
|
498
|
+
absl::make_unique<Helper>(Ref(DEBUG_LOCATION, "Helper"));
|
499
|
+
OrphanablePtr<LoadBalancingPolicy> lb_policy =
|
500
|
+
MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args),
|
501
|
+
&grpc_xds_cluster_impl_lb_trace);
|
502
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) {
|
503
|
+
gpr_log(GPR_INFO,
|
504
|
+
"[xds_cluster_impl_lb %p] Created new child policy handler %p",
|
505
|
+
this, lb_policy.get());
|
506
|
+
}
|
507
|
+
// Add our interested_parties pollset_set to that of the newly created
|
508
|
+
// child policy. This will make the child policy progress upon activity on
|
509
|
+
// this policy, which in turn is tied to the application's call.
|
510
|
+
grpc_pollset_set_add_pollset_set(lb_policy->interested_parties(),
|
511
|
+
interested_parties());
|
512
|
+
return lb_policy;
|
513
|
+
}
|
514
|
+
|
515
|
+
void XdsClusterImplLb::UpdateChildPolicyLocked(ServerAddressList addresses,
|
516
|
+
const grpc_channel_args* args) {
|
517
|
+
// Create policy if needed.
|
518
|
+
if (child_policy_ == nullptr) {
|
519
|
+
child_policy_ = CreateChildPolicyLocked(args);
|
520
|
+
}
|
521
|
+
// Construct update args.
|
522
|
+
UpdateArgs update_args;
|
523
|
+
update_args.addresses = std::move(addresses);
|
524
|
+
update_args.config = config_->child_policy();
|
525
|
+
update_args.args = args;
|
526
|
+
// Update the policy.
|
527
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) {
|
528
|
+
gpr_log(GPR_INFO,
|
529
|
+
"[xds_cluster_impl_lb %p] Updating child policy handler %p", this,
|
530
|
+
child_policy_.get());
|
531
|
+
}
|
532
|
+
child_policy_->UpdateLocked(std::move(update_args));
|
533
|
+
}
|
534
|
+
|
535
|
+
//
|
536
|
+
// XdsClusterImplLb::Helper
|
537
|
+
//
|
538
|
+
|
539
|
+
RefCountedPtr<SubchannelInterface> XdsClusterImplLb::Helper::CreateSubchannel(
|
540
|
+
ServerAddress address, const grpc_channel_args& args) {
|
541
|
+
if (xds_cluster_impl_policy_->shutting_down_) return nullptr;
|
542
|
+
// If load reporting is enabled, wrap the subchannel such that it
|
543
|
+
// includes the locality stats object, which will be used by the EdsPicker.
|
544
|
+
if (xds_cluster_impl_policy_->config_->lrs_load_reporting_server_name()
|
545
|
+
.has_value()) {
|
546
|
+
RefCountedPtr<XdsLocalityName> locality_name;
|
547
|
+
auto* attribute = address.GetAttribute(kXdsLocalityNameAttributeKey);
|
548
|
+
if (attribute != nullptr) {
|
549
|
+
const auto* locality_attr =
|
550
|
+
static_cast<const XdsLocalityAttribute*>(attribute);
|
551
|
+
locality_name = locality_attr->locality_name();
|
552
|
+
}
|
553
|
+
RefCountedPtr<XdsClusterLocalityStats> locality_stats =
|
554
|
+
xds_cluster_impl_policy_->xds_client_->AddClusterLocalityStats(
|
555
|
+
*xds_cluster_impl_policy_->config_
|
556
|
+
->lrs_load_reporting_server_name(),
|
557
|
+
xds_cluster_impl_policy_->config_->cluster_name(),
|
558
|
+
xds_cluster_impl_policy_->config_->eds_service_name(),
|
559
|
+
std::move(locality_name));
|
560
|
+
return MakeRefCounted<StatsSubchannelWrapper>(
|
561
|
+
xds_cluster_impl_policy_->channel_control_helper()->CreateSubchannel(
|
562
|
+
std::move(address), args),
|
563
|
+
std::move(locality_stats));
|
564
|
+
}
|
565
|
+
// Load reporting not enabled, so don't wrap the subchannel.
|
566
|
+
return xds_cluster_impl_policy_->channel_control_helper()->CreateSubchannel(
|
567
|
+
std::move(address), args);
|
568
|
+
}
|
569
|
+
|
570
|
+
void XdsClusterImplLb::Helper::UpdateState(
|
571
|
+
grpc_connectivity_state state, const absl::Status& status,
|
572
|
+
std::unique_ptr<SubchannelPicker> picker) {
|
573
|
+
if (xds_cluster_impl_policy_->shutting_down_) return;
|
574
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) {
|
575
|
+
gpr_log(GPR_INFO,
|
576
|
+
"[xds_cluster_impl_lb %p] child connectivity state update: "
|
577
|
+
"state=%s (%s) "
|
578
|
+
"picker=%p",
|
579
|
+
xds_cluster_impl_policy_.get(), ConnectivityStateName(state),
|
580
|
+
status.ToString().c_str(), picker.get());
|
581
|
+
}
|
582
|
+
// Save the state and picker.
|
583
|
+
xds_cluster_impl_policy_->state_ = state;
|
584
|
+
xds_cluster_impl_policy_->status_ = status;
|
585
|
+
xds_cluster_impl_policy_->picker_ =
|
586
|
+
MakeRefCounted<RefCountedPicker>(std::move(picker));
|
587
|
+
// Wrap the picker and return it to the channel.
|
588
|
+
xds_cluster_impl_policy_->MaybeUpdatePickerLocked();
|
589
|
+
}
|
590
|
+
|
591
|
+
void XdsClusterImplLb::Helper::RequestReresolution() {
|
592
|
+
if (xds_cluster_impl_policy_->shutting_down_) return;
|
593
|
+
xds_cluster_impl_policy_->channel_control_helper()->RequestReresolution();
|
594
|
+
}
|
595
|
+
|
596
|
+
void XdsClusterImplLb::Helper::AddTraceEvent(TraceSeverity severity,
|
597
|
+
absl::string_view message) {
|
598
|
+
if (xds_cluster_impl_policy_->shutting_down_) return;
|
599
|
+
xds_cluster_impl_policy_->channel_control_helper()->AddTraceEvent(severity,
|
600
|
+
message);
|
601
|
+
}
|
602
|
+
|
603
|
+
//
|
604
|
+
// factory
|
605
|
+
//
|
606
|
+
|
607
|
+
class XdsClusterImplLbFactory : public LoadBalancingPolicyFactory {
|
608
|
+
public:
|
609
|
+
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
|
610
|
+
LoadBalancingPolicy::Args args) const override {
|
611
|
+
grpc_error* error = GRPC_ERROR_NONE;
|
612
|
+
RefCountedPtr<XdsClient> xds_client = XdsClient::GetOrCreate(&error);
|
613
|
+
if (error != GRPC_ERROR_NONE) {
|
614
|
+
gpr_log(
|
615
|
+
GPR_ERROR,
|
616
|
+
"cannot get XdsClient to instantiate xds_cluster_impl LB policy: %s",
|
617
|
+
grpc_error_string(error));
|
618
|
+
GRPC_ERROR_UNREF(error);
|
619
|
+
return nullptr;
|
620
|
+
}
|
621
|
+
return MakeOrphanable<XdsClusterImplLb>(std::move(xds_client),
|
622
|
+
std::move(args));
|
623
|
+
}
|
624
|
+
|
625
|
+
const char* name() const override { return kXdsClusterImpl; }
|
626
|
+
|
627
|
+
RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
|
628
|
+
const Json& json, grpc_error** error) const override {
|
629
|
+
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
|
630
|
+
if (json.type() == Json::Type::JSON_NULL) {
|
631
|
+
// This policy was configured in the deprecated loadBalancingPolicy
|
632
|
+
// field or in the client API.
|
633
|
+
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
634
|
+
"field:loadBalancingPolicy error:xds_cluster_impl policy requires "
|
635
|
+
"configuration. Please use loadBalancingConfig field of service "
|
636
|
+
"config instead.");
|
637
|
+
return nullptr;
|
638
|
+
}
|
639
|
+
std::vector<grpc_error*> error_list;
|
640
|
+
// Child policy.
|
641
|
+
RefCountedPtr<LoadBalancingPolicy::Config> child_policy;
|
642
|
+
auto it = json.object_value().find("childPolicy");
|
643
|
+
if (it == json.object_value().end()) {
|
644
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
645
|
+
"field:childPolicy error:required field missing"));
|
646
|
+
} else {
|
647
|
+
grpc_error* parse_error = GRPC_ERROR_NONE;
|
648
|
+
child_policy = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
|
649
|
+
it->second, &parse_error);
|
650
|
+
if (child_policy == nullptr) {
|
651
|
+
GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
|
652
|
+
std::vector<grpc_error*> child_errors;
|
653
|
+
child_errors.push_back(parse_error);
|
654
|
+
error_list.push_back(
|
655
|
+
GRPC_ERROR_CREATE_FROM_VECTOR("field:childPolicy", &child_errors));
|
656
|
+
}
|
657
|
+
}
|
658
|
+
// Cluster name.
|
659
|
+
std::string cluster_name;
|
660
|
+
it = json.object_value().find("clusterName");
|
661
|
+
if (it == json.object_value().end()) {
|
662
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
663
|
+
"field:clusterName error:required field missing"));
|
664
|
+
} else if (it->second.type() != Json::Type::STRING) {
|
665
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
666
|
+
"field:clusterName error:type should be string"));
|
667
|
+
} else {
|
668
|
+
cluster_name = it->second.string_value();
|
669
|
+
}
|
670
|
+
// EDS service name.
|
671
|
+
std::string eds_service_name;
|
672
|
+
it = json.object_value().find("edsServiceName");
|
673
|
+
if (it != json.object_value().end()) {
|
674
|
+
if (it->second.type() != Json::Type::STRING) {
|
675
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
676
|
+
"field:edsServiceName error:type should be string"));
|
677
|
+
} else {
|
678
|
+
eds_service_name = it->second.string_value();
|
679
|
+
}
|
680
|
+
}
|
681
|
+
// LRS load reporting server name.
|
682
|
+
absl::optional<std::string> lrs_load_reporting_server_name;
|
683
|
+
it = json.object_value().find("lrsLoadReportingServerName");
|
684
|
+
if (it != json.object_value().end()) {
|
685
|
+
if (it->second.type() != Json::Type::STRING) {
|
686
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
687
|
+
"field:lrsLoadReportingServerName error:type should be string"));
|
688
|
+
} else {
|
689
|
+
lrs_load_reporting_server_name = it->second.string_value();
|
690
|
+
}
|
691
|
+
}
|
692
|
+
// Max concurrent requests.
|
693
|
+
uint32_t max_concurrent_requests = 1024;
|
694
|
+
it = json.object_value().find("maxConcurrentRequests");
|
695
|
+
if (it != json.object_value().end()) {
|
696
|
+
if (it->second.type() != Json::Type::NUMBER) {
|
697
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
698
|
+
"field:max_concurrent_requests error:must be of type number"));
|
699
|
+
} else {
|
700
|
+
max_concurrent_requests =
|
701
|
+
gpr_parse_nonnegative_int(it->second.string_value().c_str());
|
702
|
+
}
|
703
|
+
}
|
704
|
+
// Drop config.
|
705
|
+
auto drop_config = MakeRefCounted<XdsApi::EdsUpdate::DropConfig>();
|
706
|
+
it = json.object_value().find("dropCategories");
|
707
|
+
if (it == json.object_value().end()) {
|
708
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
709
|
+
"field:dropCategories error:required field missing"));
|
710
|
+
} else {
|
711
|
+
std::vector<grpc_error*> child_errors =
|
712
|
+
ParseDropCategories(it->second, drop_config.get());
|
713
|
+
if (!child_errors.empty()) {
|
714
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
|
715
|
+
"field:dropCategories", &child_errors));
|
716
|
+
}
|
717
|
+
}
|
718
|
+
if (!error_list.empty()) {
|
719
|
+
*error = GRPC_ERROR_CREATE_FROM_VECTOR(
|
720
|
+
"xds_cluster_impl_experimental LB policy config", &error_list);
|
721
|
+
return nullptr;
|
722
|
+
}
|
723
|
+
return MakeRefCounted<XdsClusterImplLbConfig>(
|
724
|
+
std::move(child_policy), std::move(cluster_name),
|
725
|
+
std::move(eds_service_name), std::move(lrs_load_reporting_server_name),
|
726
|
+
max_concurrent_requests, std::move(drop_config));
|
727
|
+
}
|
728
|
+
|
729
|
+
private:
|
730
|
+
static std::vector<grpc_error*> ParseDropCategories(
|
731
|
+
const Json& json, XdsApi::EdsUpdate::DropConfig* drop_config) {
|
732
|
+
std::vector<grpc_error*> error_list;
|
733
|
+
if (json.type() != Json::Type::ARRAY) {
|
734
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
735
|
+
"dropCategories field is not an array"));
|
736
|
+
return error_list;
|
737
|
+
}
|
738
|
+
for (size_t i = 0; i < json.array_value().size(); ++i) {
|
739
|
+
const Json& entry = json.array_value()[i];
|
740
|
+
std::vector<grpc_error*> child_errors =
|
741
|
+
ParseDropCategory(entry, drop_config);
|
742
|
+
if (!child_errors.empty()) {
|
743
|
+
grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
744
|
+
absl::StrCat("errors parsing index ", i).c_str());
|
745
|
+
for (size_t i = 0; i < child_errors.size(); ++i) {
|
746
|
+
error = grpc_error_add_child(error, child_errors[i]);
|
747
|
+
}
|
748
|
+
error_list.push_back(error);
|
749
|
+
}
|
750
|
+
}
|
751
|
+
return error_list;
|
752
|
+
}
|
753
|
+
|
754
|
+
static std::vector<grpc_error*> ParseDropCategory(
|
755
|
+
const Json& json, XdsApi::EdsUpdate::DropConfig* drop_config) {
|
756
|
+
std::vector<grpc_error*> error_list;
|
757
|
+
if (json.type() != Json::Type::OBJECT) {
|
758
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
759
|
+
"dropCategories entry is not an object"));
|
760
|
+
return error_list;
|
761
|
+
}
|
762
|
+
std::string category;
|
763
|
+
auto it = json.object_value().find("category");
|
764
|
+
if (it == json.object_value().end()) {
|
765
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
766
|
+
"\"category\" field not present"));
|
767
|
+
} else if (it->second.type() != Json::Type::STRING) {
|
768
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
769
|
+
"\"category\" field is not a string"));
|
770
|
+
} else {
|
771
|
+
category = it->second.string_value();
|
772
|
+
}
|
773
|
+
uint32_t requests_per_million = 0;
|
774
|
+
it = json.object_value().find("requests_per_million");
|
775
|
+
if (it == json.object_value().end()) {
|
776
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
777
|
+
"\"requests_per_million\" field is not present"));
|
778
|
+
} else if (it->second.type() != Json::Type::NUMBER) {
|
779
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
780
|
+
"\"requests_per_million\" field is not a number"));
|
781
|
+
} else {
|
782
|
+
requests_per_million =
|
783
|
+
gpr_parse_nonnegative_int(it->second.string_value().c_str());
|
784
|
+
}
|
785
|
+
if (error_list.empty()) {
|
786
|
+
drop_config->AddCategory(std::move(category), requests_per_million);
|
787
|
+
}
|
788
|
+
return error_list;
|
789
|
+
}
|
790
|
+
};
|
791
|
+
|
792
|
+
} // namespace
|
793
|
+
|
794
|
+
} // namespace grpc_core
|
795
|
+
|
796
|
+
//
|
797
|
+
// Plugin registration
|
798
|
+
//
|
799
|
+
|
800
|
+
void grpc_lb_policy_xds_cluster_impl_init() {
|
801
|
+
grpc_core::g_call_counter_map = new grpc_core::CircuitBreakerCallCounterMap();
|
802
|
+
grpc_core::LoadBalancingPolicyRegistry::Builder::
|
803
|
+
RegisterLoadBalancingPolicyFactory(
|
804
|
+
absl::make_unique<grpc_core::XdsClusterImplLbFactory>());
|
805
|
+
}
|
806
|
+
|
807
|
+
void grpc_lb_policy_xds_cluster_impl_shutdown() {
|
808
|
+
delete grpc_core::g_call_counter_map;
|
809
|
+
}
|