grpc 1.58.3 → 1.59.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Makefile +48 -33
- data/include/grpc/event_engine/event_engine.h +6 -10
- data/include/grpc/impl/channel_arg_names.h +4 -0
- data/include/grpc/support/port_platform.h +74 -1
- data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +22 -9
- data/src/core/ext/filters/client_channel/client_channel.cc +422 -56
- data/src/core/ext/filters/client_channel/client_channel.h +52 -8
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +15 -1
- data/src/core/ext/filters/client_channel/dynamic_filters.h +2 -0
- data/src/core/ext/filters/client_channel/{http_proxy.cc → http_proxy_mapper.cc} +1 -1
- data/src/core/ext/filters/client_channel/{http_proxy.h → http_proxy_mapper.h} +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/endpoint_list.cc +188 -0
- data/src/core/ext/filters/client_channel/lb_policy/endpoint_list.h +214 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +17 -4
- data/src/core/ext/filters/client_channel/lb_policy/health_check_client.cc +41 -6
- data/src/core/ext/filters/client_channel/lb_policy/health_check_client_internal.h +5 -3
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.cc +32 -103
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +0 -7
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +416 -139
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.h +16 -0
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +434 -459
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +410 -26
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +14 -46
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/weighted_round_robin.cc +851 -57
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +16 -10
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +47 -32
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_override_host.cc +55 -3
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +105 -175
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +14 -7
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +24 -6
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +36 -2
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +54 -44
- data/src/core/ext/filters/client_channel/subchannel.cc +33 -0
- data/src/core/ext/filters/client_channel/subchannel.h +9 -0
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +11 -6
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +28 -22
- data/src/core/ext/transport/chttp2/transport/flow_control.h +27 -4
- data/src/core/ext/transport/chttp2/transport/frame_data.h +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +9 -0
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +1 -1
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +34 -36
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +3 -3
- data/src/core/ext/transport/chttp2/transport/internal.h +66 -47
- data/src/core/ext/transport/chttp2/transport/{frame.h → legacy_frame.h} +3 -3
- data/src/core/ext/transport/chttp2/transport/parsing.cc +4 -2
- data/src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc +10 -0
- data/src/core/ext/transport/chttp2/transport/ping_abuse_policy.h +4 -0
- data/src/core/ext/transport/chttp2/transport/stream_lists.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/writing.cc +2 -1
- data/src/core/ext/transport/inproc/inproc_transport.cc +9 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c +16 -18
- data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h +75 -83
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c +27 -29
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h +102 -110
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +16 -18
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +73 -81
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.c +65 -67
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.h +294 -302
- data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h +20 -28
- data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c +5 -7
- data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h +24 -32
- data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h +19 -27
- data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h +10 -18
- data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h +10 -18
- data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c +42 -44
- data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h +141 -149
- data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h +8 -16
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +5 -7
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +1 -9
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +4 -12
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +36 -38
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +157 -165
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +87 -89
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +372 -380
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +13 -15
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +55 -63
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +111 -113
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +441 -449
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +8 -16
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +23 -25
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +88 -96
- data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c +40 -42
- data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h +180 -188
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +26 -28
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +108 -116
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +9 -17
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +65 -67
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +245 -253
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +27 -29
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +119 -127
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +6 -14
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +8 -16
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h +20 -28
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +49 -51
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +184 -192
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +49 -51
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +225 -233
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +13 -21
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +63 -65
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +246 -254
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +5 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +19 -27
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +5 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +19 -27
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +30 -38
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +28 -36
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +9 -17
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +12 -14
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +48 -56
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +23 -25
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +92 -100
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +27 -29
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +108 -116
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +5 -13
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +38 -40
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +167 -175
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +34 -36
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +162 -170
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +10 -12
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +37 -45
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +13 -21
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c +6 -8
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h +18 -26
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +22 -24
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +97 -105
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +24 -26
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +111 -119
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +43 -45
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +183 -191
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +20 -22
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +102 -110
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +253 -255
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +1108 -1116
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +31 -39
- data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c +35 -37
- data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h +150 -158
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h +10 -18
- data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h +8 -16
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +13 -21
- data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c +5 -7
- data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h +19 -27
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c +14 -16
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h +53 -61
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.h +8 -16
- data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h +5 -13
- data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h +24 -32
- data/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c +1 -3
- data/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h +1 -9
- data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h +23 -31
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h +23 -31
- data/src/core/ext/upb-generated/envoy/data/accesslog/v3/accesslog.upb.c +114 -116
- data/src/core/ext/upb-generated/envoy/data/accesslog/v3/accesslog.upb.h +372 -380
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +9 -17
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +30 -38
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +21 -23
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +81 -89
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +24 -32
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +12 -14
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +52 -60
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +14 -22
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +114 -116
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +468 -476
- data/src/core/ext/upb-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.h +5 -13
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +25 -33
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.c +11 -13
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +40 -48
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb.h +4 -12
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +27 -35
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.h +5 -13
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +1 -3
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +1 -9
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +35 -37
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +165 -173
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +9 -11
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +32 -40
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +39 -41
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +169 -177
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h +16 -24
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +1 -3
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h +1 -9
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +55 -57
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +241 -249
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +31 -39
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +23 -25
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +98 -106
- data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h +11 -19
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +18 -26
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.h +9 -17
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c +6 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h +16 -24
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +6 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +24 -32
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +13 -21
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +10 -18
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +6 -14
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +6 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +20 -28
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.c +1 -3
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.h +1 -9
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +33 -41
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +18 -26
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +31 -39
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +34 -42
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +14 -16
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +47 -55
- data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h +13 -21
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.c +1 -3
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.h +1 -9
- data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h +4 -12
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +10 -18
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +19 -27
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.c +6 -8
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.h +20 -28
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c +1 -3
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h +1 -9
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +10 -18
- data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h +12 -20
- data/src/core/ext/upb-generated/google/api/annotations.upb.c +2 -4
- data/src/core/ext/upb-generated/google/api/annotations.upb.h +1 -9
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +45 -47
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +190 -198
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +54 -56
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +210 -218
- data/src/core/ext/upb-generated/google/api/http.upb.c +15 -17
- data/src/core/ext/upb-generated/google/api/http.upb.h +60 -68
- data/src/core/ext/upb-generated/google/api/httpbody.upb.c +4 -6
- data/src/core/ext/upb-generated/google/api/httpbody.upb.h +15 -23
- data/src/core/ext/upb-generated/google/protobuf/any.upb.c +3 -5
- data/src/core/ext/upb-generated/google/protobuf/any.upb.h +7 -15
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +359 -204
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +1340 -760
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +3 -5
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +7 -15
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +1 -3
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +1 -9
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +11 -13
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +43 -51
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +3 -5
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +7 -15
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +10 -12
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +28 -36
- data/src/core/ext/upb-generated/google/rpc/status.upb.c +4 -6
- data/src/core/ext/upb-generated/google/rpc/status.upb.h +15 -23
- data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c +11 -13
- data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h +35 -43
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +10 -12
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +28 -36
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +48 -50
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +190 -198
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +5 -7
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +15 -23
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +3 -5
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +7 -15
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +21 -23
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +80 -88
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c +9 -11
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h +29 -37
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c +32 -34
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h +147 -155
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +10 -12
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +13 -21
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +4 -6
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +7 -15
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +2 -4
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +1 -9
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +4 -6
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +7 -15
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +3 -5
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +4 -12
- data/src/core/ext/upb-generated/validate/validate.upb.c +201 -203
- data/src/core/ext/upb-generated/validate/validate.upb.h +924 -932
- data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c +10 -12
- data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h +13 -21
- data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.c +4 -6
- data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.h +7 -15
- data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c +2 -4
- data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h +1 -9
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c +9 -11
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h +16 -24
- data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c +3 -5
- data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h +4 -12
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +2 -4
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +4 -12
- data/src/core/ext/upb-generated/xds/core/v3/cidr.upb.c +3 -5
- data/src/core/ext/upb-generated/xds/core/v3/cidr.upb.h +8 -16
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +6 -8
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +20 -28
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +4 -6
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +9 -17
- data/src/core/ext/upb-generated/xds/core/v3/extension.upb.c +3 -5
- data/src/core/ext/upb-generated/xds/core/v3/extension.upb.h +8 -16
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +4 -6
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +12 -20
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +9 -11
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +35 -43
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +5 -7
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +14 -22
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +16 -18
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +43 -51
- data/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c +3 -5
- data/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.h +13 -21
- data/src/core/ext/upb-generated/xds/type/matcher/v3/cel.upb.c +2 -4
- data/src/core/ext/upb-generated/xds/type/matcher/v3/cel.upb.h +5 -13
- data/src/core/ext/upb-generated/xds/type/matcher/v3/domain.upb.c +4 -6
- data/src/core/ext/upb-generated/xds/type/matcher/v3/domain.upb.h +21 -29
- data/src/core/ext/upb-generated/xds/type/matcher/v3/http_inputs.upb.c +1 -3
- data/src/core/ext/upb-generated/xds/type/matcher/v3/http_inputs.upb.h +1 -9
- data/src/core/ext/upb-generated/xds/type/matcher/v3/ip.upb.c +5 -7
- data/src/core/ext/upb-generated/xds/type/matcher/v3/ip.upb.h +24 -32
- data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c +24 -26
- data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h +103 -111
- data/src/core/ext/upb-generated/xds/type/matcher/v3/range.upb.c +10 -12
- data/src/core/ext/upb-generated/xds/type/matcher/v3/range.upb.h +61 -69
- data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c +3 -5
- data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h +9 -17
- data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c +8 -10
- data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h +33 -41
- data/src/core/ext/upb-generated/xds/type/v3/cel.upb.c +5 -7
- data/src/core/ext/upb-generated/xds/type/v3/cel.upb.h +18 -26
- data/src/core/ext/upb-generated/xds/type/v3/range.upb.c +7 -9
- data/src/core/ext/upb-generated/xds/type/v3/range.upb.h +19 -27
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +3 -5
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h +8 -16
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +367 -290
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h +10 -0
- data/src/core/ext/xds/xds_client.cc +6 -9
- data/src/core/ext/xds/xds_client.h +2 -2
- data/src/core/ext/xds/xds_cluster.cc +30 -42
- data/src/core/ext/xds/xds_cluster.h +0 -4
- data/src/core/ext/xds/xds_endpoint.cc +12 -19
- data/src/core/ext/xds/xds_endpoint.h +0 -1
- data/src/core/ext/xds/xds_http_filters.cc +1 -4
- data/src/core/ext/xds/xds_listener.cc +14 -14
- data/src/core/ext/xds/xds_listener.h +13 -3
- data/src/core/ext/xds/xds_resource_type.h +1 -7
- data/src/core/ext/xds/xds_resource_type_impl.h +9 -11
- data/src/core/ext/xds/xds_route_config.cc +10 -11
- data/src/core/ext/xds/xds_route_config.h +1 -1
- data/src/core/ext/xds/xds_server_config_fetcher.cc +53 -28
- data/src/core/ext/xds/xds_transport_grpc.cc +11 -1
- data/src/core/lib/backoff/random_early_detection.cc +4 -2
- data/src/core/lib/backoff/random_early_detection.h +2 -4
- data/src/core/lib/channel/call_tracer.cc +7 -1
- data/src/core/lib/channel/call_tracer.h +4 -1
- data/src/core/lib/channel/channelz_registry.h +4 -2
- data/src/core/lib/channel/connected_channel.cc +1 -1
- data/src/core/lib/config/config_vars.h +1 -1
- data/src/core/lib/config/core_configuration.cc +2 -1
- data/src/core/lib/config/core_configuration.h +5 -4
- data/src/core/lib/debug/stats_data.cc +146 -51
- data/src/core/lib/debug/stats_data.h +81 -20
- data/src/core/lib/event_engine/cf_engine/cf_engine.cc +3 -0
- data/src/core/lib/event_engine/cf_engine/cf_engine.h +3 -0
- data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +3 -0
- data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.h +3 -0
- data/src/core/lib/event_engine/cf_engine/cftype_unique_ref.h +3 -0
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc +15 -3
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.h +3 -0
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +1 -1
- data/src/core/lib/event_engine/thread_pool/thread_count.h +15 -0
- data/src/core/lib/event_engine/thread_pool/thread_pool_factory.cc +3 -15
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +10 -4
- data/src/core/lib/experiments/config.cc +9 -1
- data/src/core/lib/experiments/experiments.cc +144 -60
- data/src/core/lib/experiments/experiments.h +146 -41
- data/src/core/lib/gprpp/fork.h +1 -1
- data/src/core/lib/gprpp/manual_constructor.h +1 -2
- data/src/core/lib/gprpp/no_destruct.h +1 -1
- data/src/core/lib/gprpp/per_cpu.cc +2 -0
- data/src/core/lib/gprpp/per_cpu.h +36 -7
- data/src/core/lib/gprpp/ref_counted_ptr.h +63 -0
- data/src/core/lib/gprpp/work_serializer.cc +297 -25
- data/src/core/lib/gprpp/work_serializer.h +25 -9
- data/src/core/lib/iomgr/combiner.cc +54 -15
- data/src/core/lib/iomgr/combiner.h +8 -3
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +2 -4
- data/src/core/lib/iomgr/exec_ctx.cc +12 -0
- data/src/core/lib/iomgr/exec_ctx.h +55 -19
- data/src/core/lib/iomgr/polling_entity.cc +10 -0
- data/src/core/lib/iomgr/polling_entity.h +2 -0
- data/src/core/lib/iomgr/port.h +14 -0
- data/src/core/lib/iomgr/tcp_posix.cc +17 -14
- data/src/core/lib/load_balancing/lb_policy.h +10 -9
- data/src/core/lib/promise/arena_promise.h +5 -1
- data/src/core/lib/promise/detail/seq_state.h +418 -0
- data/src/core/lib/promise/latch.h +1 -0
- data/src/core/lib/promise/loop.h +8 -5
- data/src/core/lib/promise/pipe.h +24 -24
- data/src/core/lib/promise/poll.h +4 -6
- data/src/core/lib/resolver/server_address.h +1 -0
- data/src/core/lib/resource_quota/memory_quota.cc +58 -2
- data/src/core/lib/resource_quota/memory_quota.h +4 -1
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +115 -9
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +14 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_match.cc +86 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +0 -59
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +2 -0
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +7 -57
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +1 -1
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +2 -14
- data/src/core/lib/slice/slice.h +6 -0
- data/src/core/lib/slice/slice_buffer.cc +15 -0
- data/src/core/lib/slice/slice_buffer.h +16 -4
- data/src/core/lib/slice/slice_refcount.h +1 -1
- data/src/core/lib/surface/call.cc +92 -34
- data/src/core/lib/surface/call.h +4 -0
- data/src/core/lib/surface/channel.cc +7 -4
- data/src/core/lib/surface/channel_init.h +3 -2
- data/src/core/lib/surface/server.cc +45 -5
- data/src/core/lib/surface/server.h +18 -6
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/batch_builder.cc +3 -5
- data/src/core/lib/transport/metadata_batch.cc +6 -0
- data/src/core/lib/transport/metadata_batch.h +20 -1
- data/src/core/lib/transport/parsed_metadata.h +2 -4
- data/src/core/lib/transport/simple_slice_based_metadata.h +1 -2
- data/src/core/lib/transport/transport.h +21 -11
- data/src/core/tsi/ssl_transport_security.cc +7 -0
- data/src/core/tsi/ssl_transport_security.h +4 -0
- data/src/ruby/ext/grpc/extconf.rb +1 -1
- data/src/ruby/ext/grpc/rb_channel_args.c +6 -4
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +4 -1
- data/third_party/abseil-cpp/absl/random/bit_gen_ref.h +185 -0
- data/third_party/upb/upb/collections/array.c +6 -0
- data/third_party/upb/upb/collections/array.h +6 -0
- data/third_party/upb/upb/collections/map.c +7 -0
- data/third_party/upb/upb/collections/map.h +5 -0
- data/third_party/upb/upb/collections/map_sorter_internal.h +1 -1
- data/third_party/upb/upb/collections/message_value.h +8 -1
- data/third_party/upb/upb/generated_code_support.h +54 -0
- data/third_party/upb/upb/hash/common.c +5 -0
- data/third_party/upb/upb/hash/common.h +1 -0
- data/third_party/upb/upb/hash/str_table.h +1 -0
- data/third_party/upb/upb/message/accessors.c +25 -1
- data/third_party/upb/upb/message/accessors.h +46 -25
- data/third_party/upb/upb/message/accessors_internal.h +69 -3
- data/third_party/upb/upb/message/extension_internal.h +1 -1
- data/third_party/upb/upb/message/internal/map_entry.h +64 -0
- data/third_party/upb/upb/message/internal.h +2 -6
- data/third_party/upb/upb/message/message.c +0 -6
- data/third_party/upb/upb/message/message.h +1 -1
- data/third_party/upb/upb/message/tagged_ptr.h +89 -0
- data/third_party/upb/upb/mini_descriptor/build_enum.c +150 -0
- data/third_party/upb/upb/mini_descriptor/build_enum.h +63 -0
- data/third_party/upb/upb/{mini_table → mini_descriptor}/decode.c +122 -374
- data/third_party/upb/upb/{mini_table → mini_descriptor}/decode.h +11 -50
- data/third_party/upb/upb/mini_descriptor/internal/base92.c +46 -0
- data/third_party/upb/upb/mini_descriptor/internal/base92.h +81 -0
- data/third_party/upb/upb/mini_descriptor/internal/decoder.h +73 -0
- data/third_party/upb/upb/{mini_table → mini_descriptor/internal}/encode.c +58 -32
- data/third_party/upb/upb/{mini_table/encode_internal.h → mini_descriptor/internal/encode.h} +3 -4
- data/third_party/upb/upb/{mini_table/encode_internal.hpp → mini_descriptor/internal/encode.hpp} +1 -1
- data/third_party/upb/upb/mini_descriptor/internal/modifiers.h +50 -0
- data/third_party/upb/upb/{mini_table/common_internal.h → mini_descriptor/internal/wire_constants.h} +3 -23
- data/third_party/upb/upb/mini_descriptor/link.c +142 -0
- data/third_party/upb/upb/mini_descriptor/link.h +104 -0
- data/third_party/upb/upb/mini_table/{types.h → enum.h} +19 -9
- data/third_party/upb/upb/mini_table/extension.h +40 -0
- data/third_party/upb/upb/mini_table/extension_registry.c +1 -1
- data/third_party/upb/upb/mini_table/extension_registry.h +2 -1
- data/third_party/upb/upb/mini_table/field.h +118 -0
- data/third_party/upb/upb/{json_decode.h → mini_table/file.h} +5 -6
- data/third_party/upb/upb/mini_table/{enum_internal.h → internal/enum.h} +7 -19
- data/third_party/upb/upb/mini_table/{extension_internal.h → internal/extension.h} +8 -8
- data/third_party/upb/upb/mini_table/{field_internal.h → internal/field.h} +10 -66
- data/third_party/upb/upb/mini_table/{file_internal.h → internal/file.h} +6 -4
- data/third_party/upb/upb/mini_table/internal/message.c +39 -0
- data/third_party/upb/upb/mini_table/{message_internal.h → internal/message.h} +14 -37
- data/third_party/upb/upb/mini_table/{sub_internal.h → internal/sub.h} +7 -6
- data/third_party/upb/upb/mini_table/{common.c → message.c} +2 -33
- data/third_party/upb/upb/mini_table/{common.h → message.h} +12 -77
- data/third_party/upb/upb/{json_encode.h → mini_table/sub.h} +5 -6
- data/third_party/upb/upb/reflection/def.hpp +16 -4
- data/third_party/upb/upb/reflection/def_pool_internal.h +1 -1
- data/third_party/upb/upb/reflection/desc_state_internal.h +1 -1
- data/third_party/upb/upb/reflection/enum_def.c +1 -1
- data/third_party/upb/upb/reflection/field_def.c +2 -1
- data/third_party/upb/upb/reflection/message.c +2 -2
- data/third_party/upb/upb/reflection/message_def.c +3 -1
- data/third_party/upb/upb/wire/decode.c +68 -29
- data/third_party/upb/upb/wire/decode.h +40 -0
- data/third_party/upb/upb/wire/encode.c +23 -13
- metadata +43 -27
- data/src/core/lib/event_engine/thread_pool/original_thread_pool.cc +0 -256
- data/src/core/lib/event_engine/thread_pool/original_thread_pool.h +0 -137
@@ -37,10 +37,12 @@
|
|
37
37
|
#include <grpc/impl/connectivity_state.h>
|
38
38
|
#include <grpc/support/log.h>
|
39
39
|
|
40
|
+
#include "src/core/ext/filters/client_channel/lb_policy/endpoint_list.h"
|
40
41
|
#include "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h"
|
41
42
|
#include "src/core/lib/channel/channel_args.h"
|
42
43
|
#include "src/core/lib/config/core_configuration.h"
|
43
44
|
#include "src/core/lib/debug/trace.h"
|
45
|
+
#include "src/core/lib/experiments/experiments.h"
|
44
46
|
#include "src/core/lib/gprpp/debug_location.h"
|
45
47
|
#include "src/core/lib/gprpp/orphanable.h"
|
46
48
|
#include "src/core/lib/gprpp/ref_counted_ptr.h"
|
@@ -59,14 +61,14 @@ TraceFlag grpc_lb_round_robin_trace(false, "round_robin");
|
|
59
61
|
namespace {
|
60
62
|
|
61
63
|
//
|
62
|
-
// round_robin LB policy
|
64
|
+
// legacy round_robin LB policy (before dualstack support)
|
63
65
|
//
|
64
66
|
|
65
67
|
constexpr absl::string_view kRoundRobin = "round_robin";
|
66
68
|
|
67
|
-
class
|
69
|
+
class OldRoundRobin : public LoadBalancingPolicy {
|
68
70
|
public:
|
69
|
-
explicit
|
71
|
+
explicit OldRoundRobin(Args args);
|
70
72
|
|
71
73
|
absl::string_view name() const override { return kRoundRobin; }
|
72
74
|
|
@@ -74,7 +76,7 @@ class RoundRobin : public LoadBalancingPolicy {
|
|
74
76
|
void ResetBackoffLocked() override;
|
75
77
|
|
76
78
|
private:
|
77
|
-
~
|
79
|
+
~OldRoundRobin() override;
|
78
80
|
|
79
81
|
// Forward declaration.
|
80
82
|
class RoundRobinSubchannelList;
|
@@ -122,7 +124,7 @@ class RoundRobin : public LoadBalancingPolicy {
|
|
122
124
|
: public SubchannelList<RoundRobinSubchannelList,
|
123
125
|
RoundRobinSubchannelData> {
|
124
126
|
public:
|
125
|
-
RoundRobinSubchannelList(
|
127
|
+
RoundRobinSubchannelList(OldRoundRobin* policy, ServerAddressList addresses,
|
126
128
|
const ChannelArgs& args)
|
127
129
|
: SubchannelList(policy,
|
128
130
|
(GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)
|
@@ -137,7 +139,7 @@ class RoundRobin : public LoadBalancingPolicy {
|
|
137
139
|
}
|
138
140
|
|
139
141
|
~RoundRobinSubchannelList() override {
|
140
|
-
|
142
|
+
OldRoundRobin* p = static_cast<OldRoundRobin*>(policy());
|
141
143
|
p->Unref(DEBUG_LOCATION, "subchannel_list");
|
142
144
|
}
|
143
145
|
|
@@ -155,7 +157,7 @@ class RoundRobin : public LoadBalancingPolicy {
|
|
155
157
|
|
156
158
|
private:
|
157
159
|
std::shared_ptr<WorkSerializer> work_serializer() const override {
|
158
|
-
return static_cast<
|
160
|
+
return static_cast<OldRoundRobin*>(policy())->work_serializer();
|
159
161
|
}
|
160
162
|
|
161
163
|
std::string CountersString() const {
|
@@ -174,13 +176,13 @@ class RoundRobin : public LoadBalancingPolicy {
|
|
174
176
|
|
175
177
|
class Picker : public SubchannelPicker {
|
176
178
|
public:
|
177
|
-
Picker(
|
179
|
+
Picker(OldRoundRobin* parent, RoundRobinSubchannelList* subchannel_list);
|
178
180
|
|
179
181
|
PickResult Pick(PickArgs args) override;
|
180
182
|
|
181
183
|
private:
|
182
184
|
// Using pointer value only, no ref held -- do not dereference!
|
183
|
-
|
185
|
+
OldRoundRobin* parent_;
|
184
186
|
|
185
187
|
std::atomic<size_t> last_picked_index_;
|
186
188
|
std::vector<RefCountedPtr<SubchannelInterface>> subchannels_;
|
@@ -202,11 +204,11 @@ class RoundRobin : public LoadBalancingPolicy {
|
|
202
204
|
};
|
203
205
|
|
204
206
|
//
|
205
|
-
//
|
207
|
+
// OldRoundRobin::Picker
|
206
208
|
//
|
207
209
|
|
208
|
-
|
209
|
-
|
210
|
+
OldRoundRobin::Picker::Picker(OldRoundRobin* parent,
|
211
|
+
RoundRobinSubchannelList* subchannel_list)
|
210
212
|
: parent_(parent) {
|
211
213
|
for (size_t i = 0; i < subchannel_list->num_subchannels(); ++i) {
|
212
214
|
RoundRobinSubchannelData* sd = subchannel_list->subchannel(i);
|
@@ -228,7 +230,7 @@ RoundRobin::Picker::Picker(RoundRobin* parent,
|
|
228
230
|
}
|
229
231
|
}
|
230
232
|
|
231
|
-
|
233
|
+
OldRoundRobin::PickResult OldRoundRobin::Picker::Pick(PickArgs /*args*/) {
|
232
234
|
size_t index = last_picked_index_.fetch_add(1, std::memory_order_relaxed) %
|
233
235
|
subchannels_.size();
|
234
236
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
|
@@ -243,13 +245,13 @@ RoundRobin::PickResult RoundRobin::Picker::Pick(PickArgs /*args*/) {
|
|
243
245
|
// RoundRobin
|
244
246
|
//
|
245
247
|
|
246
|
-
|
248
|
+
OldRoundRobin::OldRoundRobin(Args args) : LoadBalancingPolicy(std::move(args)) {
|
247
249
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
|
248
250
|
gpr_log(GPR_INFO, "[RR %p] Created", this);
|
249
251
|
}
|
250
252
|
}
|
251
253
|
|
252
|
-
|
254
|
+
OldRoundRobin::~OldRoundRobin() {
|
253
255
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
|
254
256
|
gpr_log(GPR_INFO, "[RR %p] Destroying Round Robin policy", this);
|
255
257
|
}
|
@@ -257,7 +259,7 @@ RoundRobin::~RoundRobin() {
|
|
257
259
|
GPR_ASSERT(latest_pending_subchannel_list_ == nullptr);
|
258
260
|
}
|
259
261
|
|
260
|
-
void
|
262
|
+
void OldRoundRobin::ShutdownLocked() {
|
261
263
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
|
262
264
|
gpr_log(GPR_INFO, "[RR %p] Shutting down", this);
|
263
265
|
}
|
@@ -266,14 +268,14 @@ void RoundRobin::ShutdownLocked() {
|
|
266
268
|
latest_pending_subchannel_list_.reset();
|
267
269
|
}
|
268
270
|
|
269
|
-
void
|
271
|
+
void OldRoundRobin::ResetBackoffLocked() {
|
270
272
|
subchannel_list_->ResetBackoffLocked();
|
271
273
|
if (latest_pending_subchannel_list_ != nullptr) {
|
272
274
|
latest_pending_subchannel_list_->ResetBackoffLocked();
|
273
275
|
}
|
274
276
|
}
|
275
277
|
|
276
|
-
absl::Status
|
278
|
+
absl::Status OldRoundRobin::UpdateLocked(UpdateArgs args) {
|
277
279
|
ServerAddressList addresses;
|
278
280
|
if (args.addresses.ok()) {
|
279
281
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
|
@@ -329,7 +331,7 @@ absl::Status RoundRobin::UpdateLocked(UpdateArgs args) {
|
|
329
331
|
// RoundRobinSubchannelList
|
330
332
|
//
|
331
333
|
|
332
|
-
void
|
334
|
+
void OldRoundRobin::RoundRobinSubchannelList::UpdateStateCountersLocked(
|
333
335
|
absl::optional<grpc_connectivity_state> old_state,
|
334
336
|
grpc_connectivity_state new_state) {
|
335
337
|
if (old_state.has_value()) {
|
@@ -355,9 +357,9 @@ void RoundRobin::RoundRobinSubchannelList::UpdateStateCountersLocked(
|
|
355
357
|
}
|
356
358
|
}
|
357
359
|
|
358
|
-
void
|
360
|
+
void OldRoundRobin::RoundRobinSubchannelList::
|
359
361
|
MaybeUpdateRoundRobinConnectivityStateLocked(absl::Status status_for_tf) {
|
360
|
-
|
362
|
+
OldRoundRobin* p = static_cast<OldRoundRobin*>(policy());
|
361
363
|
// If this is latest_pending_subchannel_list_, then swap it into
|
362
364
|
// subchannel_list_ in the following cases:
|
363
365
|
// - subchannel_list_ has no READY subchannels.
|
@@ -424,10 +426,10 @@ void RoundRobin::RoundRobinSubchannelList::
|
|
424
426
|
// RoundRobinSubchannelData
|
425
427
|
//
|
426
428
|
|
427
|
-
void
|
429
|
+
void OldRoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked(
|
428
430
|
absl::optional<grpc_connectivity_state> old_state,
|
429
431
|
grpc_connectivity_state new_state) {
|
430
|
-
|
432
|
+
OldRoundRobin* p = static_cast<OldRoundRobin*>(subchannel_list()->policy());
|
431
433
|
GPR_ASSERT(subchannel() != nullptr);
|
432
434
|
// If this is not the initial state notification and the new state is
|
433
435
|
// TRANSIENT_FAILURE or IDLE, re-resolve.
|
@@ -457,9 +459,10 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked(
|
|
457
459
|
connectivity_status());
|
458
460
|
}
|
459
461
|
|
460
|
-
void
|
461
|
-
|
462
|
-
|
462
|
+
void OldRoundRobin::RoundRobinSubchannelData::
|
463
|
+
UpdateLogicalConnectivityStateLocked(
|
464
|
+
grpc_connectivity_state connectivity_state) {
|
465
|
+
OldRoundRobin* p = static_cast<OldRoundRobin*>(subchannel_list()->policy());
|
463
466
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
|
464
467
|
gpr_log(
|
465
468
|
GPR_INFO,
|
@@ -503,6 +506,384 @@ void RoundRobin::RoundRobinSubchannelData::UpdateLogicalConnectivityStateLocked(
|
|
503
506
|
logical_connectivity_state_ = connectivity_state;
|
504
507
|
}
|
505
508
|
|
509
|
+
//
|
510
|
+
// round_robin LB policy (with dualstack changes)
|
511
|
+
//
|
512
|
+
|
513
|
+
class RoundRobin : public LoadBalancingPolicy {
|
514
|
+
public:
|
515
|
+
explicit RoundRobin(Args args);
|
516
|
+
|
517
|
+
absl::string_view name() const override { return kRoundRobin; }
|
518
|
+
|
519
|
+
absl::Status UpdateLocked(UpdateArgs args) override;
|
520
|
+
void ResetBackoffLocked() override;
|
521
|
+
|
522
|
+
private:
|
523
|
+
class RoundRobinEndpointList : public EndpointList {
|
524
|
+
public:
|
525
|
+
RoundRobinEndpointList(RefCountedPtr<RoundRobin> round_robin,
|
526
|
+
const ServerAddressList& addresses,
|
527
|
+
const ChannelArgs& args)
|
528
|
+
: EndpointList(std::move(round_robin),
|
529
|
+
GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)
|
530
|
+
? "RoundRobinEndpointList"
|
531
|
+
: nullptr) {
|
532
|
+
Init(addresses, args,
|
533
|
+
[&](RefCountedPtr<RoundRobinEndpointList> endpoint_list,
|
534
|
+
const ServerAddress& address, const ChannelArgs& args) {
|
535
|
+
return MakeOrphanable<RoundRobinEndpoint>(
|
536
|
+
std::move(endpoint_list), address, args,
|
537
|
+
policy<RoundRobin>()->work_serializer());
|
538
|
+
});
|
539
|
+
}
|
540
|
+
|
541
|
+
private:
|
542
|
+
class RoundRobinEndpoint : public Endpoint {
|
543
|
+
public:
|
544
|
+
RoundRobinEndpoint(RefCountedPtr<RoundRobinEndpointList> endpoint_list,
|
545
|
+
const ServerAddress& address, const ChannelArgs& args,
|
546
|
+
std::shared_ptr<WorkSerializer> work_serializer)
|
547
|
+
: Endpoint(std::move(endpoint_list)) {
|
548
|
+
Init(address, args, std::move(work_serializer));
|
549
|
+
}
|
550
|
+
|
551
|
+
private:
|
552
|
+
// Called when the child policy reports a connectivity state update.
|
553
|
+
void OnStateUpdate(absl::optional<grpc_connectivity_state> old_state,
|
554
|
+
grpc_connectivity_state new_state,
|
555
|
+
const absl::Status& status) override;
|
556
|
+
};
|
557
|
+
|
558
|
+
LoadBalancingPolicy::ChannelControlHelper* channel_control_helper()
|
559
|
+
const override {
|
560
|
+
return policy<RoundRobin>()->channel_control_helper();
|
561
|
+
}
|
562
|
+
|
563
|
+
// Updates the counters of children in each state when a
|
564
|
+
// child transitions from old_state to new_state.
|
565
|
+
void UpdateStateCountersLocked(
|
566
|
+
absl::optional<grpc_connectivity_state> old_state,
|
567
|
+
grpc_connectivity_state new_state);
|
568
|
+
|
569
|
+
// Ensures that the right child list is used and then updates
|
570
|
+
// the RR policy's connectivity state based on the child list's
|
571
|
+
// state counters.
|
572
|
+
void MaybeUpdateRoundRobinConnectivityStateLocked(
|
573
|
+
absl::Status status_for_tf);
|
574
|
+
|
575
|
+
std::string CountersString() const {
|
576
|
+
return absl::StrCat("num_children=", size(), " num_ready=", num_ready_,
|
577
|
+
" num_connecting=", num_connecting_,
|
578
|
+
" num_transient_failure=", num_transient_failure_);
|
579
|
+
}
|
580
|
+
|
581
|
+
size_t num_ready_ = 0;
|
582
|
+
size_t num_connecting_ = 0;
|
583
|
+
size_t num_transient_failure_ = 0;
|
584
|
+
|
585
|
+
absl::Status last_failure_;
|
586
|
+
};
|
587
|
+
|
588
|
+
class Picker : public SubchannelPicker {
|
589
|
+
public:
|
590
|
+
Picker(RoundRobin* parent,
|
591
|
+
std::vector<RefCountedPtr<LoadBalancingPolicy::SubchannelPicker>>
|
592
|
+
pickers);
|
593
|
+
|
594
|
+
PickResult Pick(PickArgs args) override;
|
595
|
+
|
596
|
+
private:
|
597
|
+
// Using pointer value only, no ref held -- do not dereference!
|
598
|
+
RoundRobin* parent_;
|
599
|
+
|
600
|
+
std::atomic<size_t> last_picked_index_;
|
601
|
+
std::vector<RefCountedPtr<LoadBalancingPolicy::SubchannelPicker>> pickers_;
|
602
|
+
};
|
603
|
+
|
604
|
+
~RoundRobin() override;
|
605
|
+
|
606
|
+
void ShutdownLocked() override;
|
607
|
+
|
608
|
+
// Current child list.
|
609
|
+
OrphanablePtr<RoundRobinEndpointList> endpoint_list_;
|
610
|
+
// Latest pending child list.
|
611
|
+
// When we get an updated address list, we create a new child list
|
612
|
+
// for it here, and we wait to swap it into endpoint_list_ until the new
|
613
|
+
// list becomes READY.
|
614
|
+
OrphanablePtr<RoundRobinEndpointList> latest_pending_endpoint_list_;
|
615
|
+
|
616
|
+
bool shutdown_ = false;
|
617
|
+
|
618
|
+
absl::BitGen bit_gen_;
|
619
|
+
};
|
620
|
+
|
621
|
+
//
|
622
|
+
// RoundRobin::Picker
|
623
|
+
//
|
624
|
+
|
625
|
+
RoundRobin::Picker::Picker(
|
626
|
+
RoundRobin* parent,
|
627
|
+
std::vector<RefCountedPtr<LoadBalancingPolicy::SubchannelPicker>> pickers)
|
628
|
+
: parent_(parent), pickers_(std::move(pickers)) {
|
629
|
+
// For discussion on why we generate a random starting index for
|
630
|
+
// the picker, see https://github.com/grpc/grpc-go/issues/2580.
|
631
|
+
size_t index = absl::Uniform<size_t>(parent->bit_gen_, 0, pickers_.size());
|
632
|
+
last_picked_index_.store(index, std::memory_order_relaxed);
|
633
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
|
634
|
+
gpr_log(GPR_INFO,
|
635
|
+
"[RR %p picker %p] created picker from endpoint_list=%p "
|
636
|
+
"with %" PRIuPTR " READY children; last_picked_index_=%" PRIuPTR,
|
637
|
+
parent_, this, parent_->endpoint_list_.get(), pickers_.size(),
|
638
|
+
index);
|
639
|
+
}
|
640
|
+
}
|
641
|
+
|
642
|
+
RoundRobin::PickResult RoundRobin::Picker::Pick(PickArgs args) {
|
643
|
+
size_t index = last_picked_index_.fetch_add(1, std::memory_order_relaxed) %
|
644
|
+
pickers_.size();
|
645
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
|
646
|
+
gpr_log(GPR_INFO,
|
647
|
+
"[RR %p picker %p] using picker index %" PRIuPTR ", picker=%p",
|
648
|
+
parent_, this, index, pickers_[index].get());
|
649
|
+
}
|
650
|
+
return pickers_[index]->Pick(args);
|
651
|
+
}
|
652
|
+
|
653
|
+
//
|
654
|
+
// RoundRobin
|
655
|
+
//
|
656
|
+
|
657
|
+
RoundRobin::RoundRobin(Args args) : LoadBalancingPolicy(std::move(args)) {
|
658
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
|
659
|
+
gpr_log(GPR_INFO, "[RR %p] Created", this);
|
660
|
+
}
|
661
|
+
}
|
662
|
+
|
663
|
+
RoundRobin::~RoundRobin() {
|
664
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
|
665
|
+
gpr_log(GPR_INFO, "[RR %p] Destroying Round Robin policy", this);
|
666
|
+
}
|
667
|
+
GPR_ASSERT(endpoint_list_ == nullptr);
|
668
|
+
GPR_ASSERT(latest_pending_endpoint_list_ == nullptr);
|
669
|
+
}
|
670
|
+
|
671
|
+
void RoundRobin::ShutdownLocked() {
|
672
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
|
673
|
+
gpr_log(GPR_INFO, "[RR %p] Shutting down", this);
|
674
|
+
}
|
675
|
+
shutdown_ = true;
|
676
|
+
endpoint_list_.reset();
|
677
|
+
latest_pending_endpoint_list_.reset();
|
678
|
+
}
|
679
|
+
|
680
|
+
void RoundRobin::ResetBackoffLocked() {
|
681
|
+
endpoint_list_->ResetBackoffLocked();
|
682
|
+
if (latest_pending_endpoint_list_ != nullptr) {
|
683
|
+
latest_pending_endpoint_list_->ResetBackoffLocked();
|
684
|
+
}
|
685
|
+
}
|
686
|
+
|
687
|
+
absl::Status RoundRobin::UpdateLocked(UpdateArgs args) {
|
688
|
+
ServerAddressList addresses;
|
689
|
+
if (args.addresses.ok()) {
|
690
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
|
691
|
+
gpr_log(GPR_INFO, "[RR %p] received update with %" PRIuPTR " addresses",
|
692
|
+
this, args.addresses->size());
|
693
|
+
}
|
694
|
+
addresses = std::move(*args.addresses);
|
695
|
+
} else {
|
696
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
|
697
|
+
gpr_log(GPR_INFO, "[RR %p] received update with address error: %s", this,
|
698
|
+
args.addresses.status().ToString().c_str());
|
699
|
+
}
|
700
|
+
// If we already have a child list, then keep using the existing
|
701
|
+
// list, but still report back that the update was not accepted.
|
702
|
+
if (endpoint_list_ != nullptr) return args.addresses.status();
|
703
|
+
}
|
704
|
+
// Create new child list, replacing the previous pending list, if any.
|
705
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace) &&
|
706
|
+
latest_pending_endpoint_list_ != nullptr) {
|
707
|
+
gpr_log(GPR_INFO, "[RR %p] replacing previous pending child list %p", this,
|
708
|
+
latest_pending_endpoint_list_.get());
|
709
|
+
}
|
710
|
+
latest_pending_endpoint_list_ = MakeOrphanable<RoundRobinEndpointList>(
|
711
|
+
Ref(DEBUG_LOCATION, "RoundRobinEndpointList"), std::move(addresses),
|
712
|
+
args.args);
|
713
|
+
// If the new list is empty, immediately promote it to
|
714
|
+
// endpoint_list_ and report TRANSIENT_FAILURE.
|
715
|
+
// TODO(roth): As part of adding dualstack backend support, we need to
|
716
|
+
// also handle the case where the list of addresses for a given
|
717
|
+
// endpoint is empty.
|
718
|
+
if (latest_pending_endpoint_list_->size() == 0) {
|
719
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace) &&
|
720
|
+
endpoint_list_ != nullptr) {
|
721
|
+
gpr_log(GPR_INFO, "[RR %p] replacing previous child list %p", this,
|
722
|
+
endpoint_list_.get());
|
723
|
+
}
|
724
|
+
endpoint_list_ = std::move(latest_pending_endpoint_list_);
|
725
|
+
absl::Status status =
|
726
|
+
args.addresses.ok() ? absl::UnavailableError(absl::StrCat(
|
727
|
+
"empty address list: ", args.resolution_note))
|
728
|
+
: args.addresses.status();
|
729
|
+
channel_control_helper()->UpdateState(
|
730
|
+
GRPC_CHANNEL_TRANSIENT_FAILURE, status,
|
731
|
+
MakeRefCounted<TransientFailurePicker>(status));
|
732
|
+
return status;
|
733
|
+
}
|
734
|
+
// Otherwise, if this is the initial update, immediately promote it to
|
735
|
+
// endpoint_list_.
|
736
|
+
if (endpoint_list_ == nullptr) {
|
737
|
+
endpoint_list_ = std::move(latest_pending_endpoint_list_);
|
738
|
+
}
|
739
|
+
return absl::OkStatus();
|
740
|
+
}
|
741
|
+
|
742
|
+
//
|
743
|
+
// RoundRobin::RoundRobinEndpointList::RoundRobinEndpoint
|
744
|
+
//
|
745
|
+
|
746
|
+
void RoundRobin::RoundRobinEndpointList::RoundRobinEndpoint::OnStateUpdate(
|
747
|
+
absl::optional<grpc_connectivity_state> old_state,
|
748
|
+
grpc_connectivity_state new_state, const absl::Status& status) {
|
749
|
+
auto* rr_endpoint_list = endpoint_list<RoundRobinEndpointList>();
|
750
|
+
auto* round_robin = policy<RoundRobin>();
|
751
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
|
752
|
+
gpr_log(GPR_INFO,
|
753
|
+
"[RR %p] connectivity changed for child %p, endpoint_list %p "
|
754
|
+
"(index %" PRIuPTR " of %" PRIuPTR
|
755
|
+
"): prev_state=%s new_state=%s "
|
756
|
+
"(%s)",
|
757
|
+
round_robin, this, rr_endpoint_list, Index(),
|
758
|
+
rr_endpoint_list->size(),
|
759
|
+
(old_state.has_value() ? ConnectivityStateName(*old_state) : "N/A"),
|
760
|
+
ConnectivityStateName(new_state), status.ToString().c_str());
|
761
|
+
}
|
762
|
+
if (new_state == GRPC_CHANNEL_IDLE) {
|
763
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
|
764
|
+
gpr_log(GPR_INFO, "[RR %p] child %p reported IDLE; requesting connection",
|
765
|
+
round_robin, this);
|
766
|
+
}
|
767
|
+
ExitIdleLocked();
|
768
|
+
}
|
769
|
+
// If state changed, update state counters.
|
770
|
+
if (!old_state.has_value() || *old_state != new_state) {
|
771
|
+
rr_endpoint_list->UpdateStateCountersLocked(old_state, new_state);
|
772
|
+
}
|
773
|
+
// Update the policy state.
|
774
|
+
rr_endpoint_list->MaybeUpdateRoundRobinConnectivityStateLocked(status);
|
775
|
+
}
|
776
|
+
|
777
|
+
//
|
778
|
+
// RoundRobin::RoundRobinEndpointList
|
779
|
+
//
|
780
|
+
|
781
|
+
void RoundRobin::RoundRobinEndpointList::UpdateStateCountersLocked(
|
782
|
+
absl::optional<grpc_connectivity_state> old_state,
|
783
|
+
grpc_connectivity_state new_state) {
|
784
|
+
// We treat IDLE the same as CONNECTING, since it will immediately
|
785
|
+
// transition into that state anyway.
|
786
|
+
if (old_state.has_value()) {
|
787
|
+
GPR_ASSERT(*old_state != GRPC_CHANNEL_SHUTDOWN);
|
788
|
+
if (*old_state == GRPC_CHANNEL_READY) {
|
789
|
+
GPR_ASSERT(num_ready_ > 0);
|
790
|
+
--num_ready_;
|
791
|
+
} else if (*old_state == GRPC_CHANNEL_CONNECTING ||
|
792
|
+
*old_state == GRPC_CHANNEL_IDLE) {
|
793
|
+
GPR_ASSERT(num_connecting_ > 0);
|
794
|
+
--num_connecting_;
|
795
|
+
} else if (*old_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
|
796
|
+
GPR_ASSERT(num_transient_failure_ > 0);
|
797
|
+
--num_transient_failure_;
|
798
|
+
}
|
799
|
+
}
|
800
|
+
GPR_ASSERT(new_state != GRPC_CHANNEL_SHUTDOWN);
|
801
|
+
if (new_state == GRPC_CHANNEL_READY) {
|
802
|
+
++num_ready_;
|
803
|
+
} else if (new_state == GRPC_CHANNEL_CONNECTING ||
|
804
|
+
new_state == GRPC_CHANNEL_IDLE) {
|
805
|
+
++num_connecting_;
|
806
|
+
} else if (new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
|
807
|
+
++num_transient_failure_;
|
808
|
+
}
|
809
|
+
}
|
810
|
+
|
811
|
+
void RoundRobin::RoundRobinEndpointList::
|
812
|
+
MaybeUpdateRoundRobinConnectivityStateLocked(absl::Status status_for_tf) {
|
813
|
+
auto* round_robin = policy<RoundRobin>();
|
814
|
+
// If this is latest_pending_endpoint_list_, then swap it into
|
815
|
+
// endpoint_list_ in the following cases:
|
816
|
+
// - endpoint_list_ has no READY children.
|
817
|
+
// - This list has at least one READY child and we have seen the
|
818
|
+
// initial connectivity state notification for all children.
|
819
|
+
// - All of the children in this list are in TRANSIENT_FAILURE.
|
820
|
+
// (This may cause the channel to go from READY to TRANSIENT_FAILURE,
|
821
|
+
// but we're doing what the control plane told us to do.)
|
822
|
+
if (round_robin->latest_pending_endpoint_list_.get() == this &&
|
823
|
+
(round_robin->endpoint_list_->num_ready_ == 0 ||
|
824
|
+
(num_ready_ > 0 && AllEndpointsSeenInitialState()) ||
|
825
|
+
num_transient_failure_ == size())) {
|
826
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
|
827
|
+
const std::string old_counters_string =
|
828
|
+
round_robin->endpoint_list_ != nullptr
|
829
|
+
? round_robin->endpoint_list_->CountersString()
|
830
|
+
: "";
|
831
|
+
gpr_log(GPR_INFO,
|
832
|
+
"[RR %p] swapping out child list %p (%s) in favor of %p (%s)",
|
833
|
+
round_robin, round_robin->endpoint_list_.get(),
|
834
|
+
old_counters_string.c_str(), this, CountersString().c_str());
|
835
|
+
}
|
836
|
+
round_robin->endpoint_list_ =
|
837
|
+
std::move(round_robin->latest_pending_endpoint_list_);
|
838
|
+
}
|
839
|
+
// Only set connectivity state if this is the current child list.
|
840
|
+
if (round_robin->endpoint_list_.get() != this) return;
|
841
|
+
// FIXME: scan children each time instead of keeping counters?
|
842
|
+
// First matching rule wins:
|
843
|
+
// 1) ANY child is READY => policy is READY.
|
844
|
+
// 2) ANY child is CONNECTING => policy is CONNECTING.
|
845
|
+
// 3) ALL children are TRANSIENT_FAILURE => policy is TRANSIENT_FAILURE.
|
846
|
+
if (num_ready_ > 0) {
|
847
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
|
848
|
+
gpr_log(GPR_INFO, "[RR %p] reporting READY with child list %p",
|
849
|
+
round_robin, this);
|
850
|
+
}
|
851
|
+
std::vector<RefCountedPtr<LoadBalancingPolicy::SubchannelPicker>> pickers;
|
852
|
+
for (const auto& endpoint : endpoints()) {
|
853
|
+
auto state = endpoint->connectivity_state();
|
854
|
+
if (state.has_value() && *state == GRPC_CHANNEL_READY) {
|
855
|
+
pickers.push_back(endpoint->picker());
|
856
|
+
}
|
857
|
+
}
|
858
|
+
GPR_ASSERT(!pickers.empty());
|
859
|
+
round_robin->channel_control_helper()->UpdateState(
|
860
|
+
GRPC_CHANNEL_READY, absl::OkStatus(),
|
861
|
+
MakeRefCounted<Picker>(round_robin, std::move(pickers)));
|
862
|
+
} else if (num_connecting_ > 0) {
|
863
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
|
864
|
+
gpr_log(GPR_INFO, "[RR %p] reporting CONNECTING with child list %p",
|
865
|
+
round_robin, this);
|
866
|
+
}
|
867
|
+
round_robin->channel_control_helper()->UpdateState(
|
868
|
+
GRPC_CHANNEL_CONNECTING, absl::Status(),
|
869
|
+
MakeRefCounted<QueuePicker>(nullptr));
|
870
|
+
} else if (num_transient_failure_ == size()) {
|
871
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
|
872
|
+
gpr_log(GPR_INFO,
|
873
|
+
"[RR %p] reporting TRANSIENT_FAILURE with child list %p: %s",
|
874
|
+
round_robin, this, status_for_tf.ToString().c_str());
|
875
|
+
}
|
876
|
+
if (!status_for_tf.ok()) {
|
877
|
+
last_failure_ = absl::UnavailableError(
|
878
|
+
absl::StrCat("connections to all backends failing; last error: ",
|
879
|
+
status_for_tf.message()));
|
880
|
+
}
|
881
|
+
round_robin->channel_control_helper()->UpdateState(
|
882
|
+
GRPC_CHANNEL_TRANSIENT_FAILURE, last_failure_,
|
883
|
+
MakeRefCounted<TransientFailurePicker>(last_failure_));
|
884
|
+
}
|
885
|
+
}
|
886
|
+
|
506
887
|
//
|
507
888
|
// factory
|
508
889
|
//
|
@@ -516,6 +897,9 @@ class RoundRobinFactory : public LoadBalancingPolicyFactory {
|
|
516
897
|
public:
|
517
898
|
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
|
518
899
|
LoadBalancingPolicy::Args args) const override {
|
900
|
+
if (!IsRoundRobinDelegateToPickFirstEnabled()) {
|
901
|
+
return MakeOrphanable<OldRoundRobin>(std::move(args));
|
902
|
+
}
|
519
903
|
return MakeOrphanable<RoundRobin>(std::move(args));
|
520
904
|
}
|
521
905
|
|