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
@@ -16,6 +16,8 @@
|
|
16
16
|
|
17
17
|
#include <grpc/support/port_platform.h>
|
18
18
|
|
19
|
+
#include "src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.h"
|
20
|
+
|
19
21
|
#include <inttypes.h>
|
20
22
|
#include <string.h>
|
21
23
|
|
@@ -33,19 +35,18 @@
|
|
33
35
|
#include "absl/strings/string_view.h"
|
34
36
|
#include "absl/types/optional.h"
|
35
37
|
|
36
|
-
#include <grpc/impl/channel_arg_names.h>
|
37
38
|
#include <grpc/impl/connectivity_state.h>
|
38
39
|
#include <grpc/support/log.h>
|
39
40
|
|
40
|
-
#include "src/core/ext/filters/client_channel/lb_policy/
|
41
|
-
#include "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h"
|
41
|
+
#include "src/core/ext/filters/client_channel/lb_policy/health_check_client.h"
|
42
42
|
#include "src/core/lib/channel/channel_args.h"
|
43
43
|
#include "src/core/lib/config/core_configuration.h"
|
44
44
|
#include "src/core/lib/debug/trace.h"
|
45
|
+
#include "src/core/lib/gprpp/crash.h"
|
45
46
|
#include "src/core/lib/gprpp/debug_location.h"
|
46
47
|
#include "src/core/lib/gprpp/orphanable.h"
|
47
48
|
#include "src/core/lib/gprpp/ref_counted_ptr.h"
|
48
|
-
#include "src/core/lib/
|
49
|
+
#include "src/core/lib/iomgr/iomgr_fwd.h"
|
49
50
|
#include "src/core/lib/json/json.h"
|
50
51
|
#include "src/core/lib/json/json_args.h"
|
51
52
|
#include "src/core/lib/json/json_object_loader.h"
|
@@ -98,72 +99,140 @@ class PickFirst : public LoadBalancingPolicy {
|
|
98
99
|
private:
|
99
100
|
~PickFirst() override;
|
100
101
|
|
101
|
-
class
|
102
|
-
|
103
|
-
class PickFirstSubchannelData
|
104
|
-
: public SubchannelData<PickFirstSubchannelList,
|
105
|
-
PickFirstSubchannelData> {
|
102
|
+
class SubchannelList : public InternallyRefCounted<SubchannelList> {
|
106
103
|
public:
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
104
|
+
class SubchannelData {
|
105
|
+
public:
|
106
|
+
SubchannelData(SubchannelList* subchannel_list,
|
107
|
+
RefCountedPtr<SubchannelInterface> subchannel);
|
108
|
+
|
109
|
+
SubchannelInterface* subchannel() const { return subchannel_.get(); }
|
110
|
+
absl::optional<grpc_connectivity_state> connectivity_state() const {
|
111
|
+
return connectivity_state_;
|
112
|
+
}
|
113
|
+
|
114
|
+
// Returns the index into the subchannel list of this object.
|
115
|
+
size_t Index() const {
|
116
|
+
return static_cast<size_t>(this -
|
117
|
+
&subchannel_list_->subchannels_.front());
|
118
|
+
}
|
119
|
+
|
120
|
+
// Resets the connection backoff.
|
121
|
+
void ResetBackoffLocked() {
|
122
|
+
if (subchannel_ != nullptr) subchannel_->ResetBackoff();
|
123
|
+
}
|
124
|
+
|
125
|
+
// Cancels any pending connectivity watch and unrefs the subchannel.
|
126
|
+
void ShutdownLocked();
|
127
|
+
|
128
|
+
private:
|
129
|
+
// Watcher for subchannel connectivity state.
|
130
|
+
class Watcher
|
131
|
+
: public SubchannelInterface::ConnectivityStateWatcherInterface {
|
132
|
+
public:
|
133
|
+
Watcher(SubchannelData* subchannel_data,
|
134
|
+
RefCountedPtr<SubchannelList> subchannel_list)
|
135
|
+
: subchannel_data_(subchannel_data),
|
136
|
+
subchannel_list_(std::move(subchannel_list)) {}
|
137
|
+
|
138
|
+
~Watcher() override {
|
139
|
+
subchannel_list_.reset(DEBUG_LOCATION, "Watcher dtor");
|
140
|
+
}
|
141
|
+
|
142
|
+
void OnConnectivityStateChange(grpc_connectivity_state new_state,
|
143
|
+
absl::Status status) override {
|
144
|
+
subchannel_data_->OnConnectivityStateChange(new_state,
|
145
|
+
std::move(status));
|
146
|
+
}
|
147
|
+
|
148
|
+
grpc_pollset_set* interested_parties() override {
|
149
|
+
return subchannel_list_->policy_->interested_parties();
|
150
|
+
}
|
151
|
+
|
152
|
+
private:
|
153
|
+
SubchannelData* subchannel_data_;
|
154
|
+
RefCountedPtr<SubchannelList> subchannel_list_;
|
155
|
+
};
|
156
|
+
|
157
|
+
// This method will be invoked once soon after instantiation to report
|
158
|
+
// the current connectivity state, and it will then be invoked again
|
159
|
+
// whenever the connectivity state changes.
|
160
|
+
void OnConnectivityStateChange(grpc_connectivity_state new_state,
|
161
|
+
absl::Status status);
|
113
162
|
|
114
|
-
|
115
|
-
|
116
|
-
|
163
|
+
// Processes the connectivity change to READY for an unselected
|
164
|
+
// subchannel.
|
165
|
+
void ProcessUnselectedReadyLocked();
|
166
|
+
|
167
|
+
// Reacts to the current connectivity state while trying to connect.
|
168
|
+
void ReactToConnectivityStateLocked();
|
169
|
+
|
170
|
+
// Backpointer to owning subchannel list. Not owned.
|
171
|
+
SubchannelList* subchannel_list_;
|
172
|
+
// The subchannel.
|
173
|
+
RefCountedPtr<SubchannelInterface> subchannel_;
|
174
|
+
// Will be non-null when the subchannel's state is being watched.
|
175
|
+
SubchannelInterface::ConnectivityStateWatcherInterface* pending_watcher_ =
|
176
|
+
nullptr;
|
177
|
+
// Data updated by the watcher.
|
178
|
+
absl::optional<grpc_connectivity_state> connectivity_state_;
|
179
|
+
absl::Status connectivity_status_;
|
180
|
+
};
|
181
|
+
|
182
|
+
SubchannelList(RefCountedPtr<PickFirst> policy, ServerAddressList addresses,
|
183
|
+
const ChannelArgs& args);
|
184
|
+
|
185
|
+
~SubchannelList() override;
|
186
|
+
|
187
|
+
// The number of subchannels in the list.
|
188
|
+
size_t size() const { return subchannels_.size(); }
|
189
|
+
|
190
|
+
// Resets connection backoff of all subchannels.
|
191
|
+
void ResetBackoffLocked();
|
192
|
+
|
193
|
+
void Orphan() override;
|
117
194
|
|
118
195
|
private:
|
119
|
-
//
|
120
|
-
|
196
|
+
// Returns true if all subchannels have seen their initial
|
197
|
+
// connectivity state notifications.
|
198
|
+
bool AllSubchannelsSeenInitialState();
|
121
199
|
|
122
|
-
//
|
123
|
-
|
200
|
+
// Backpointer to owning policy.
|
201
|
+
RefCountedPtr<PickFirst> policy_;
|
202
|
+
|
203
|
+
ChannelArgs args_;
|
204
|
+
|
205
|
+
// The list of subchannels.
|
206
|
+
std::vector<SubchannelData> subchannels_;
|
207
|
+
|
208
|
+
// Is this list shutting down? This may be true due to the shutdown of the
|
209
|
+
// policy itself or because a newer update has arrived while this one hadn't
|
210
|
+
// finished processing.
|
211
|
+
bool shutting_down_ = false;
|
212
|
+
|
213
|
+
bool in_transient_failure_ = false;
|
214
|
+
size_t attempting_index_ = 0;
|
124
215
|
};
|
125
216
|
|
126
|
-
class
|
127
|
-
: public
|
128
|
-
PickFirstSubchannelData> {
|
217
|
+
class HealthWatcher
|
218
|
+
: public SubchannelInterface::ConnectivityStateWatcherInterface {
|
129
219
|
public:
|
130
|
-
|
131
|
-
|
132
|
-
: SubchannelList(policy,
|
133
|
-
(GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)
|
134
|
-
? "PickFirstSubchannelList"
|
135
|
-
: nullptr),
|
136
|
-
std::move(addresses), policy->channel_control_helper(),
|
137
|
-
args) {
|
138
|
-
// Need to maintain a ref to the LB policy as long as we maintain
|
139
|
-
// any references to subchannels, since the subchannels'
|
140
|
-
// pollset_sets will include the LB policy's pollset_set.
|
141
|
-
policy->Ref(DEBUG_LOCATION, "subchannel_list").release();
|
142
|
-
// Note that we do not start trying to connect to any subchannel here,
|
143
|
-
// since we will wait until we see the initial connectivity state for all
|
144
|
-
// subchannels before doing that.
|
145
|
-
}
|
220
|
+
explicit HealthWatcher(RefCountedPtr<PickFirst> policy)
|
221
|
+
: policy_(std::move(policy)) {}
|
146
222
|
|
147
|
-
~
|
148
|
-
|
149
|
-
p->Unref(DEBUG_LOCATION, "subchannel_list");
|
223
|
+
~HealthWatcher() override {
|
224
|
+
policy_.reset(DEBUG_LOCATION, "HealthWatcher dtor");
|
150
225
|
}
|
151
226
|
|
152
|
-
|
153
|
-
|
154
|
-
in_transient_failure_ = in_transient_failure;
|
155
|
-
}
|
156
|
-
|
157
|
-
size_t attempting_index() const { return attempting_index_; }
|
158
|
-
void set_attempting_index(size_t index) { attempting_index_ = index; }
|
227
|
+
void OnConnectivityStateChange(grpc_connectivity_state new_state,
|
228
|
+
absl::Status status) override;
|
159
229
|
|
160
|
-
|
161
|
-
|
162
|
-
return static_cast<PickFirst*>(policy())->work_serializer();
|
230
|
+
grpc_pollset_set* interested_parties() override {
|
231
|
+
return policy_->interested_parties();
|
163
232
|
}
|
164
233
|
|
165
|
-
|
166
|
-
|
234
|
+
private:
|
235
|
+
RefCountedPtr<PickFirst> policy_;
|
167
236
|
};
|
168
237
|
|
169
238
|
class Picker : public SubchannelPicker {
|
@@ -181,19 +250,30 @@ class PickFirst : public LoadBalancingPolicy {
|
|
181
250
|
|
182
251
|
void ShutdownLocked() override;
|
183
252
|
|
184
|
-
void AttemptToConnectUsingLatestUpdateArgsLocked();
|
185
|
-
|
186
253
|
void UpdateState(grpc_connectivity_state state, const absl::Status& status,
|
187
254
|
RefCountedPtr<SubchannelPicker> picker);
|
188
255
|
|
256
|
+
void AttemptToConnectUsingLatestUpdateArgsLocked();
|
257
|
+
|
258
|
+
void UnsetSelectedSubchannel();
|
259
|
+
|
260
|
+
// Whether we should enable health watching.
|
261
|
+
const bool enable_health_watch_;
|
262
|
+
// Whether we should omit our status message prefix.
|
263
|
+
const bool omit_status_message_prefix_;
|
264
|
+
|
189
265
|
// Lateset update args.
|
190
266
|
UpdateArgs latest_update_args_;
|
191
267
|
// All our subchannels.
|
192
|
-
|
268
|
+
OrphanablePtr<SubchannelList> subchannel_list_;
|
193
269
|
// Latest pending subchannel list.
|
194
|
-
|
195
|
-
// Selected subchannel in
|
196
|
-
|
270
|
+
OrphanablePtr<SubchannelList> latest_pending_subchannel_list_;
|
271
|
+
// Selected subchannel in subchannel_list_.
|
272
|
+
SubchannelList::SubchannelData* selected_ = nullptr;
|
273
|
+
// Health watcher for the selected subchannel.
|
274
|
+
SubchannelInterface::ConnectivityStateWatcherInterface* health_watcher_ =
|
275
|
+
nullptr;
|
276
|
+
SubchannelInterface::DataWatcherInterface* health_data_watcher_ = nullptr;
|
197
277
|
// Current connectivity state.
|
198
278
|
grpc_connectivity_state state_ = GRPC_CHANNEL_CONNECTING;
|
199
279
|
// Are we shut down?
|
@@ -202,7 +282,16 @@ class PickFirst : public LoadBalancingPolicy {
|
|
202
282
|
absl::BitGen bit_gen_;
|
203
283
|
};
|
204
284
|
|
205
|
-
PickFirst::PickFirst(Args args)
|
285
|
+
PickFirst::PickFirst(Args args)
|
286
|
+
: LoadBalancingPolicy(std::move(args)),
|
287
|
+
enable_health_watch_(
|
288
|
+
channel_args()
|
289
|
+
.GetBool(GRPC_ARG_INTERNAL_PICK_FIRST_ENABLE_HEALTH_CHECKING)
|
290
|
+
.value_or(false)),
|
291
|
+
omit_status_message_prefix_(
|
292
|
+
channel_args()
|
293
|
+
.GetBool(GRPC_ARG_INTERNAL_PICK_FIRST_OMIT_STATUS_MESSAGE_PREFIX)
|
294
|
+
.value_or(false)) {
|
206
295
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
|
207
296
|
gpr_log(GPR_INFO, "Pick First %p created.", this);
|
208
297
|
}
|
@@ -221,13 +310,17 @@ void PickFirst::ShutdownLocked() {
|
|
221
310
|
gpr_log(GPR_INFO, "Pick First %p Shutting down", this);
|
222
311
|
}
|
223
312
|
shutdown_ = true;
|
313
|
+
UnsetSelectedSubchannel();
|
224
314
|
subchannel_list_.reset();
|
225
315
|
latest_pending_subchannel_list_.reset();
|
226
316
|
}
|
227
317
|
|
228
318
|
void PickFirst::ExitIdleLocked() {
|
229
319
|
if (shutdown_) return;
|
230
|
-
|
320
|
+
// Need to check subchannel_list_ being null here, in case the
|
321
|
+
// application calls channel->GetState(true) again before we
|
322
|
+
// transition to state CONNECTING.
|
323
|
+
if (state_ == GRPC_CHANNEL_IDLE && subchannel_list_ == nullptr) {
|
231
324
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
|
232
325
|
gpr_log(GPR_INFO, "Pick First %p exiting idle", this);
|
233
326
|
}
|
@@ -255,13 +348,11 @@ void PickFirst::AttemptToConnectUsingLatestUpdateArgsLocked() {
|
|
255
348
|
"[PF %p] Shutting down previous pending subchannel list %p", this,
|
256
349
|
latest_pending_subchannel_list_.get());
|
257
350
|
}
|
258
|
-
latest_pending_subchannel_list_ =
|
259
|
-
|
260
|
-
latest_pending_subchannel_list_->StartWatchingLocked(
|
261
|
-
latest_update_args_.args);
|
351
|
+
latest_pending_subchannel_list_ = MakeOrphanable<SubchannelList>(
|
352
|
+
Ref(), std::move(addresses), latest_update_args_.args);
|
262
353
|
// Empty update or no valid subchannels. Put the channel in
|
263
354
|
// TRANSIENT_FAILURE and request re-resolution.
|
264
|
-
if (latest_pending_subchannel_list_->
|
355
|
+
if (latest_pending_subchannel_list_->size() == 0) {
|
265
356
|
channel_control_helper()->RequestReresolution();
|
266
357
|
absl::Status status =
|
267
358
|
latest_update_args_.addresses.ok()
|
@@ -273,9 +364,8 @@ void PickFirst::AttemptToConnectUsingLatestUpdateArgsLocked() {
|
|
273
364
|
}
|
274
365
|
// If the new update is empty or we don't yet have a selected subchannel in
|
275
366
|
// the current list, replace the current subchannel list immediately.
|
276
|
-
if (latest_pending_subchannel_list_->
|
277
|
-
|
278
|
-
selected_ = nullptr;
|
367
|
+
if (latest_pending_subchannel_list_->size() == 0 || selected_ == nullptr) {
|
368
|
+
UnsetSelectedSubchannel();
|
279
369
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace) &&
|
280
370
|
subchannel_list_ != nullptr) {
|
281
371
|
gpr_log(GPR_INFO, "[PF %p] Shutting down previous subchannel list %p",
|
@@ -296,8 +386,6 @@ absl::Status PickFirst::UpdateLocked(UpdateArgs args) {
|
|
296
386
|
this, args.addresses.status().ToString().c_str());
|
297
387
|
}
|
298
388
|
}
|
299
|
-
// Add GRPC_ARG_INHIBIT_HEALTH_CHECKING channel arg.
|
300
|
-
args.args = args.args.Set(GRPC_ARG_INHIBIT_HEALTH_CHECKING, 1);
|
301
389
|
// Set return status based on the address list.
|
302
390
|
absl::Status status;
|
303
391
|
if (!args.addresses.ok()) {
|
@@ -310,19 +398,6 @@ absl::Status PickFirst::UpdateLocked(UpdateArgs args) {
|
|
310
398
|
absl::c_shuffle(*args.addresses, bit_gen_);
|
311
399
|
}
|
312
400
|
}
|
313
|
-
// TODO(roth): This is a hack to disable outlier_detection when used
|
314
|
-
// with pick_first, for the reasons described in
|
315
|
-
// https://github.com/grpc/grpc/issues/32967. Remove this when
|
316
|
-
// implementing the dualstack design.
|
317
|
-
if (args.addresses.ok()) {
|
318
|
-
ServerAddressList addresses;
|
319
|
-
for (const auto& address : *args.addresses) {
|
320
|
-
addresses.emplace_back(
|
321
|
-
address.address(),
|
322
|
-
address.args().Set(GRPC_ARG_OUTLIER_DETECTION_DISABLE, 1));
|
323
|
-
}
|
324
|
-
args.addresses = std::move(addresses);
|
325
|
-
}
|
326
401
|
// If the update contains a resolver error and we have a previous update
|
327
402
|
// that was not a resolver error, keep using the previous addresses.
|
328
403
|
if (!args.addresses.ok() && latest_update_args_.config != nullptr) {
|
@@ -345,18 +420,122 @@ void PickFirst::UpdateState(grpc_connectivity_state state,
|
|
345
420
|
channel_control_helper()->UpdateState(state, status, std::move(picker));
|
346
421
|
}
|
347
422
|
|
348
|
-
void PickFirst::
|
349
|
-
|
350
|
-
|
351
|
-
|
423
|
+
void PickFirst::UnsetSelectedSubchannel() {
|
424
|
+
if (selected_ != nullptr && health_data_watcher_ != nullptr) {
|
425
|
+
selected_->subchannel()->CancelDataWatcher(health_data_watcher_);
|
426
|
+
}
|
427
|
+
selected_ = nullptr;
|
428
|
+
health_watcher_ = nullptr;
|
429
|
+
health_data_watcher_ = nullptr;
|
430
|
+
}
|
431
|
+
|
432
|
+
//
|
433
|
+
// PickFirst::HealthWatcher
|
434
|
+
//
|
435
|
+
|
436
|
+
void PickFirst::HealthWatcher::OnConnectivityStateChange(
|
437
|
+
grpc_connectivity_state new_state, absl::Status status) {
|
438
|
+
if (policy_->health_watcher_ != this) return;
|
439
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
|
440
|
+
gpr_log(GPR_INFO, "[PF %p] health watch state update: %s (%s)",
|
441
|
+
policy_.get(), ConnectivityStateName(new_state),
|
442
|
+
status.ToString().c_str());
|
443
|
+
}
|
444
|
+
switch (new_state) {
|
445
|
+
case GRPC_CHANNEL_READY:
|
446
|
+
policy_->channel_control_helper()->UpdateState(
|
447
|
+
GRPC_CHANNEL_READY, absl::OkStatus(),
|
448
|
+
MakeRefCounted<Picker>(policy_->selected_->subchannel()->Ref()));
|
449
|
+
break;
|
450
|
+
case GRPC_CHANNEL_IDLE:
|
451
|
+
// If the subchannel becomes disconnected, the health watcher
|
452
|
+
// might happen to see the change before the raw connectivity
|
453
|
+
// state watcher does. In this case, ignore it, since the raw
|
454
|
+
// connectivity state watcher will handle it shortly.
|
455
|
+
break;
|
456
|
+
case GRPC_CHANNEL_CONNECTING:
|
457
|
+
policy_->channel_control_helper()->UpdateState(
|
458
|
+
new_state, absl::OkStatus(),
|
459
|
+
MakeRefCounted<QueuePicker>(policy_->Ref()));
|
460
|
+
break;
|
461
|
+
case GRPC_CHANNEL_TRANSIENT_FAILURE:
|
462
|
+
policy_->channel_control_helper()->UpdateState(
|
463
|
+
GRPC_CHANNEL_TRANSIENT_FAILURE, status,
|
464
|
+
MakeRefCounted<TransientFailurePicker>(status));
|
465
|
+
break;
|
466
|
+
case GRPC_CHANNEL_SHUTDOWN:
|
467
|
+
Crash("health watcher reported state SHUTDOWN");
|
468
|
+
}
|
469
|
+
}
|
470
|
+
|
471
|
+
//
|
472
|
+
// PickFirst::SubchannelList::SubchannelData
|
473
|
+
//
|
474
|
+
|
475
|
+
PickFirst::SubchannelList::SubchannelData::SubchannelData(
|
476
|
+
SubchannelList* subchannel_list,
|
477
|
+
RefCountedPtr<SubchannelInterface> subchannel)
|
478
|
+
: subchannel_list_(subchannel_list), subchannel_(std::move(subchannel)) {
|
479
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
|
480
|
+
gpr_log(GPR_INFO,
|
481
|
+
"[PF %p] subchannel list %p index %" PRIuPTR
|
482
|
+
" (subchannel %p): starting watch",
|
483
|
+
subchannel_list_->policy_.get(), subchannel_list_,
|
484
|
+
subchannel_list_->size(), subchannel_.get());
|
485
|
+
}
|
486
|
+
auto watcher = std::make_unique<Watcher>(
|
487
|
+
this, subchannel_list_->Ref(DEBUG_LOCATION, "Watcher"));
|
488
|
+
pending_watcher_ = watcher.get();
|
489
|
+
subchannel_->WatchConnectivityState(std::move(watcher));
|
490
|
+
}
|
491
|
+
|
492
|
+
void PickFirst::SubchannelList::SubchannelData::ShutdownLocked() {
|
493
|
+
if (subchannel_ != nullptr) {
|
494
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
|
495
|
+
gpr_log(GPR_INFO,
|
496
|
+
"[PF %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR
|
497
|
+
" (subchannel %p): cancelling watch and unreffing subchannel",
|
498
|
+
subchannel_list_->policy_.get(), subchannel_list_, Index(),
|
499
|
+
subchannel_list_->size(), subchannel_.get());
|
500
|
+
}
|
501
|
+
subchannel_->CancelConnectivityStateWatch(pending_watcher_);
|
502
|
+
pending_watcher_ = nullptr;
|
503
|
+
subchannel_.reset();
|
504
|
+
}
|
505
|
+
}
|
506
|
+
|
507
|
+
void PickFirst::SubchannelList::SubchannelData::OnConnectivityStateChange(
|
508
|
+
grpc_connectivity_state new_state, absl::Status status) {
|
509
|
+
PickFirst* p = subchannel_list_->policy_.get();
|
510
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
|
511
|
+
gpr_log(
|
512
|
+
GPR_INFO,
|
513
|
+
"[PF %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR
|
514
|
+
" (subchannel %p): connectivity changed: old_state=%s, new_state=%s, "
|
515
|
+
"status=%s, shutting_down=%d, pending_watcher=%p, "
|
516
|
+
"p->selected_=%p, p->subchannel_list_=%p, "
|
517
|
+
"p->latest_pending_subchannel_list_=%p",
|
518
|
+
p, subchannel_list_, Index(), subchannel_list_->size(),
|
519
|
+
subchannel_.get(),
|
520
|
+
(connectivity_state_.has_value()
|
521
|
+
? ConnectivityStateName(*connectivity_state_)
|
522
|
+
: "N/A"),
|
523
|
+
ConnectivityStateName(new_state), status.ToString().c_str(),
|
524
|
+
subchannel_list_->shutting_down_, pending_watcher_, p->selected_,
|
525
|
+
p->subchannel_list_.get(), p->latest_pending_subchannel_list_.get());
|
526
|
+
}
|
527
|
+
if (subchannel_list_->shutting_down_ || pending_watcher_ == nullptr) return;
|
352
528
|
// The notification must be for a subchannel in either the current or
|
353
529
|
// latest pending subchannel lists.
|
354
|
-
GPR_ASSERT(
|
355
|
-
|
530
|
+
GPR_ASSERT(subchannel_list_ == p->subchannel_list_.get() ||
|
531
|
+
subchannel_list_ == p->latest_pending_subchannel_list_.get());
|
356
532
|
GPR_ASSERT(new_state != GRPC_CHANNEL_SHUTDOWN);
|
533
|
+
absl::optional<grpc_connectivity_state> old_state = connectivity_state_;
|
534
|
+
connectivity_state_ = new_state;
|
535
|
+
connectivity_status_ = status;
|
357
536
|
// Handle updates for the currently selected subchannel.
|
358
537
|
if (p->selected_ == this) {
|
359
|
-
GPR_ASSERT(
|
538
|
+
GPR_ASSERT(subchannel_list_ == p->subchannel_list_.get());
|
360
539
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
|
361
540
|
gpr_log(GPR_INFO,
|
362
541
|
"Pick First %p selected subchannel connectivity changed to %s", p,
|
@@ -380,17 +559,15 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked(
|
|
380
559
|
p, p->latest_pending_subchannel_list_.get(),
|
381
560
|
p->subchannel_list_.get());
|
382
561
|
}
|
383
|
-
p->
|
562
|
+
p->UnsetSelectedSubchannel();
|
384
563
|
p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_);
|
385
564
|
// Set our state to that of the pending subchannel list.
|
386
|
-
if (p->subchannel_list_->
|
565
|
+
if (p->subchannel_list_->in_transient_failure_) {
|
387
566
|
absl::Status status = absl::UnavailableError(absl::StrCat(
|
388
567
|
"selected subchannel failed; switching to pending update; "
|
389
568
|
"last failure: ",
|
390
|
-
p->subchannel_list_
|
391
|
-
|
392
|
-
->connectivity_status()
|
393
|
-
.ToString()));
|
569
|
+
p->subchannel_list_->subchannels_.back()
|
570
|
+
.connectivity_status_.ToString()));
|
394
571
|
p->UpdateState(GRPC_CHANNEL_TRANSIENT_FAILURE, status,
|
395
572
|
MakeRefCounted<TransientFailurePicker>(status));
|
396
573
|
} else if (p->state_ != GRPC_CHANNEL_TRANSIENT_FAILURE) {
|
@@ -400,7 +577,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked(
|
|
400
577
|
return;
|
401
578
|
}
|
402
579
|
// Enter idle.
|
403
|
-
p->
|
580
|
+
p->UnsetSelectedSubchannel();
|
404
581
|
p->subchannel_list_.reset();
|
405
582
|
p->UpdateState(
|
406
583
|
GRPC_CHANNEL_IDLE, absl::Status(),
|
@@ -418,32 +595,33 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked(
|
|
418
595
|
// select in place of the current one.
|
419
596
|
// If the subchannel is READY, use it.
|
420
597
|
if (new_state == GRPC_CHANNEL_READY) {
|
421
|
-
|
598
|
+
subchannel_list_->in_transient_failure_ = false;
|
422
599
|
ProcessUnselectedReadyLocked();
|
423
600
|
return;
|
424
601
|
}
|
425
602
|
// If we haven't yet seen the initial connectivity state notification
|
426
603
|
// for all subchannels, do nothing.
|
427
|
-
if (!
|
604
|
+
if (!subchannel_list_->AllSubchannelsSeenInitialState()) return;
|
428
605
|
// If we're still here and this is the initial connectivity state
|
429
606
|
// notification for this subchannel, that means it was the last one to
|
430
607
|
// see its initial notification. Start trying to connect, starting
|
431
608
|
// with the first subchannel.
|
432
609
|
if (!old_state.has_value()) {
|
433
|
-
|
610
|
+
subchannel_list_->subchannels_.front().ReactToConnectivityStateLocked();
|
434
611
|
return;
|
435
612
|
}
|
436
613
|
// Ignore any other updates for subchannels we're not currently trying to
|
437
614
|
// connect to.
|
438
|
-
if (Index() !=
|
615
|
+
if (Index() != subchannel_list_->attempting_index_) return;
|
439
616
|
// React to the connectivity state.
|
440
617
|
ReactToConnectivityStateLocked();
|
441
618
|
}
|
442
619
|
|
443
|
-
void PickFirst::
|
444
|
-
|
620
|
+
void PickFirst::SubchannelList::SubchannelData::
|
621
|
+
ReactToConnectivityStateLocked() {
|
622
|
+
PickFirst* p = subchannel_list_->policy_.get();
|
445
623
|
// Otherwise, process connectivity state.
|
446
|
-
switch (
|
624
|
+
switch (connectivity_state_.value()) {
|
447
625
|
case GRPC_CHANNEL_READY:
|
448
626
|
// Already handled this case above, so this should not happen.
|
449
627
|
GPR_UNREACHABLE_CODE(break);
|
@@ -451,13 +629,13 @@ void PickFirst::PickFirstSubchannelData::ReactToConnectivityStateLocked() {
|
|
451
629
|
// Find the next subchannel not in state TRANSIENT_FAILURE.
|
452
630
|
// We skip subchannels in state TRANSIENT_FAILURE to avoid a
|
453
631
|
// large recursion that could overflow the stack.
|
454
|
-
|
632
|
+
SubchannelData* found_subchannel = nullptr;
|
455
633
|
for (size_t next_index = Index() + 1;
|
456
|
-
next_index <
|
457
|
-
|
458
|
-
GPR_ASSERT(sc->
|
459
|
-
if (sc->
|
460
|
-
|
634
|
+
next_index < subchannel_list_->size(); ++next_index) {
|
635
|
+
SubchannelData* sc = &subchannel_list_->subchannels_[next_index];
|
636
|
+
GPR_ASSERT(sc->connectivity_state_.has_value());
|
637
|
+
if (sc->connectivity_state_ != GRPC_CHANNEL_TRANSIENT_FAILURE) {
|
638
|
+
subchannel_list_->attempting_index_ = next_index;
|
461
639
|
found_subchannel = sc;
|
462
640
|
break;
|
463
641
|
}
|
@@ -475,14 +653,14 @@ void PickFirst::PickFirstSubchannelData::ReactToConnectivityStateLocked() {
|
|
475
653
|
gpr_log(GPR_INFO,
|
476
654
|
"Pick First %p subchannel list %p failed to connect to "
|
477
655
|
"all subchannels",
|
478
|
-
p,
|
656
|
+
p, subchannel_list_);
|
479
657
|
}
|
480
|
-
|
481
|
-
|
658
|
+
subchannel_list_->attempting_index_ = 0;
|
659
|
+
subchannel_list_->in_transient_failure_ = true;
|
482
660
|
// In case 2, swap to the new subchannel list. This means reporting
|
483
661
|
// TRANSIENT_FAILURE and dropping the existing (working) connection,
|
484
662
|
// but we can't ignore what the control plane has told us.
|
485
|
-
if (
|
663
|
+
if (subchannel_list_ == p->latest_pending_subchannel_list_.get()) {
|
486
664
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
|
487
665
|
gpr_log(GPR_INFO,
|
488
666
|
"Pick First %p promoting pending subchannel list %p to "
|
@@ -490,36 +668,38 @@ void PickFirst::PickFirstSubchannelData::ReactToConnectivityStateLocked() {
|
|
490
668
|
p, p->latest_pending_subchannel_list_.get(),
|
491
669
|
p->subchannel_list_.get());
|
492
670
|
}
|
493
|
-
p->
|
671
|
+
p->UnsetSelectedSubchannel();
|
494
672
|
p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_);
|
495
673
|
}
|
496
674
|
// If this is the current subchannel list (either because we were
|
497
675
|
// in case 1 or because we were in case 2 and just promoted it to
|
498
676
|
// be the current list), re-resolve and report new state.
|
499
|
-
if (
|
677
|
+
if (subchannel_list_ == p->subchannel_list_.get()) {
|
500
678
|
p->channel_control_helper()->RequestReresolution();
|
501
|
-
absl::Status status = absl::UnavailableError(
|
502
|
-
|
503
|
-
|
679
|
+
absl::Status status = absl::UnavailableError(absl::StrCat(
|
680
|
+
(p->omit_status_message_prefix_
|
681
|
+
? ""
|
682
|
+
: "failed to connect to all addresses; last error: "),
|
683
|
+
connectivity_status_.ToString()));
|
504
684
|
p->UpdateState(GRPC_CHANNEL_TRANSIENT_FAILURE, status,
|
505
685
|
MakeRefCounted<TransientFailurePicker>(status));
|
506
686
|
}
|
507
687
|
// If the first subchannel is already IDLE, trigger the next connection
|
508
|
-
// attempt immediately.
|
688
|
+
// attempt immediately. Otherwise, we'll wait for it to report
|
509
689
|
// its own connectivity state change.
|
510
|
-
auto
|
511
|
-
if (subchannel0
|
512
|
-
subchannel0->
|
690
|
+
auto& subchannel0 = subchannel_list_->subchannels_.front();
|
691
|
+
if (subchannel0.connectivity_state_ == GRPC_CHANNEL_IDLE) {
|
692
|
+
subchannel0.subchannel_->RequestConnection();
|
513
693
|
}
|
514
694
|
break;
|
515
695
|
}
|
516
696
|
case GRPC_CHANNEL_IDLE:
|
517
|
-
|
697
|
+
subchannel_->RequestConnection();
|
518
698
|
break;
|
519
699
|
case GRPC_CHANNEL_CONNECTING:
|
520
700
|
// Only update connectivity state in case 1, and only if we're not
|
521
701
|
// already in TRANSIENT_FAILURE.
|
522
|
-
if (
|
702
|
+
if (subchannel_list_ == p->subchannel_list_.get() &&
|
523
703
|
p->state_ != GRPC_CHANNEL_TRANSIENT_FAILURE) {
|
524
704
|
p->UpdateState(GRPC_CHANNEL_CONNECTING, absl::Status(),
|
525
705
|
MakeRefCounted<QueuePicker>(nullptr));
|
@@ -530,8 +710,8 @@ void PickFirst::PickFirstSubchannelData::ReactToConnectivityStateLocked() {
|
|
530
710
|
}
|
531
711
|
}
|
532
712
|
|
533
|
-
void PickFirst::
|
534
|
-
PickFirst* p =
|
713
|
+
void PickFirst::SubchannelList::SubchannelData::ProcessUnselectedReadyLocked() {
|
714
|
+
PickFirst* p = subchannel_list_->policy_.get();
|
535
715
|
// If we get here, there are two possible cases:
|
536
716
|
// 1. We do not currently have a selected subchannel, and the update is
|
537
717
|
// for a subchannel in p->subchannel_list_ that we're trying to
|
@@ -541,10 +721,10 @@ void PickFirst::PickFirstSubchannelData::ProcessUnselectedReadyLocked() {
|
|
541
721
|
// for a subchannel in p->latest_pending_subchannel_list_. The
|
542
722
|
// goal here is to find a subchannel from the update that we can
|
543
723
|
// select in place of the current one.
|
544
|
-
GPR_ASSERT(
|
545
|
-
|
724
|
+
GPR_ASSERT(subchannel_list_ == p->subchannel_list_.get() ||
|
725
|
+
subchannel_list_ == p->latest_pending_subchannel_list_.get());
|
546
726
|
// Case 2. Promote p->latest_pending_subchannel_list_ to p->subchannel_list_.
|
547
|
-
if (
|
727
|
+
if (subchannel_list_ == p->latest_pending_subchannel_list_.get()) {
|
548
728
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
|
549
729
|
gpr_log(GPR_INFO,
|
550
730
|
"Pick First %p promoting pending subchannel list %p to "
|
@@ -556,18 +736,115 @@ void PickFirst::PickFirstSubchannelData::ProcessUnselectedReadyLocked() {
|
|
556
736
|
}
|
557
737
|
// Cases 1 and 2.
|
558
738
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
|
559
|
-
gpr_log(GPR_INFO, "Pick First %p selected subchannel %p", p,
|
739
|
+
gpr_log(GPR_INFO, "Pick First %p selected subchannel %p", p,
|
740
|
+
subchannel_.get());
|
560
741
|
}
|
561
742
|
p->selected_ = this;
|
562
|
-
|
563
|
-
|
564
|
-
for
|
743
|
+
// If health checking is enabled, start the health watch, but don't
|
744
|
+
// report a new picker -- we want to stay in CONNECTING while we wait
|
745
|
+
// for the health status notification.
|
746
|
+
// If health checking is NOT enabled, report READY.
|
747
|
+
if (p->enable_health_watch_) {
|
748
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
|
749
|
+
gpr_log(GPR_INFO, "[PF %p] starting health watch", p);
|
750
|
+
}
|
751
|
+
auto watcher = std::make_unique<HealthWatcher>(
|
752
|
+
p->Ref(DEBUG_LOCATION, "HealthWatcher"));
|
753
|
+
p->health_watcher_ = watcher.get();
|
754
|
+
auto health_data_watcher = MakeHealthCheckWatcher(
|
755
|
+
p->work_serializer(), subchannel_list_->args_, std::move(watcher));
|
756
|
+
p->health_data_watcher_ = health_data_watcher.get();
|
757
|
+
subchannel_->AddDataWatcher(std::move(health_data_watcher));
|
758
|
+
} else {
|
759
|
+
p->UpdateState(GRPC_CHANNEL_READY, absl::Status(),
|
760
|
+
MakeRefCounted<Picker>(subchannel()->Ref()));
|
761
|
+
}
|
762
|
+
// Unref all other subchannels in the list.
|
763
|
+
for (size_t i = 0; i < subchannel_list_->size(); ++i) {
|
565
764
|
if (i != Index()) {
|
566
|
-
|
765
|
+
subchannel_list_->subchannels_[i].ShutdownLocked();
|
567
766
|
}
|
568
767
|
}
|
569
768
|
}
|
570
769
|
|
770
|
+
//
|
771
|
+
// PickFirst::SubchannelList
|
772
|
+
//
|
773
|
+
|
774
|
+
PickFirst::SubchannelList::SubchannelList(RefCountedPtr<PickFirst> policy,
|
775
|
+
ServerAddressList addresses,
|
776
|
+
const ChannelArgs& args)
|
777
|
+
: InternallyRefCounted<SubchannelList>(
|
778
|
+
GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace) ? "SubchannelList"
|
779
|
+
: nullptr),
|
780
|
+
policy_(std::move(policy)),
|
781
|
+
args_(args.Remove(GRPC_ARG_INTERNAL_PICK_FIRST_ENABLE_HEALTH_CHECKING)
|
782
|
+
.Remove(
|
783
|
+
GRPC_ARG_INTERNAL_PICK_FIRST_OMIT_STATUS_MESSAGE_PREFIX)) {
|
784
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
|
785
|
+
gpr_log(GPR_INFO,
|
786
|
+
"[PF %p] Creating subchannel list %p for %" PRIuPTR
|
787
|
+
" subchannels - channel args: %s",
|
788
|
+
policy_.get(), this, addresses.size(), args_.ToString().c_str());
|
789
|
+
}
|
790
|
+
subchannels_.reserve(addresses.size());
|
791
|
+
// Create a subchannel for each address.
|
792
|
+
for (const ServerAddress& address : addresses) {
|
793
|
+
RefCountedPtr<SubchannelInterface> subchannel =
|
794
|
+
policy_->channel_control_helper()->CreateSubchannel(address, args_);
|
795
|
+
if (subchannel == nullptr) {
|
796
|
+
// Subchannel could not be created.
|
797
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
|
798
|
+
gpr_log(GPR_INFO,
|
799
|
+
"[PF %p] could not create subchannel for address %s, ignoring",
|
800
|
+
policy_.get(), address.ToString().c_str());
|
801
|
+
}
|
802
|
+
continue;
|
803
|
+
}
|
804
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
|
805
|
+
gpr_log(GPR_INFO,
|
806
|
+
"[PF %p] subchannel list %p index %" PRIuPTR
|
807
|
+
": Created subchannel %p for address %s",
|
808
|
+
policy_.get(), this, subchannels_.size(), subchannel.get(),
|
809
|
+
address.ToString().c_str());
|
810
|
+
}
|
811
|
+
subchannels_.emplace_back(this, std::move(subchannel));
|
812
|
+
}
|
813
|
+
}
|
814
|
+
|
815
|
+
PickFirst::SubchannelList::~SubchannelList() {
|
816
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
|
817
|
+
gpr_log(GPR_INFO, "[PF %p] Destroying subchannel_list %p", policy_.get(),
|
818
|
+
this);
|
819
|
+
}
|
820
|
+
}
|
821
|
+
|
822
|
+
void PickFirst::SubchannelList::Orphan() {
|
823
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
|
824
|
+
gpr_log(GPR_INFO, "[PF %p] Shutting down subchannel_list %p", policy_.get(),
|
825
|
+
this);
|
826
|
+
}
|
827
|
+
GPR_ASSERT(!shutting_down_);
|
828
|
+
shutting_down_ = true;
|
829
|
+
for (auto& sd : subchannels_) {
|
830
|
+
sd.ShutdownLocked();
|
831
|
+
}
|
832
|
+
Unref();
|
833
|
+
}
|
834
|
+
|
835
|
+
void PickFirst::SubchannelList::ResetBackoffLocked() {
|
836
|
+
for (auto& sd : subchannels_) {
|
837
|
+
sd.ResetBackoffLocked();
|
838
|
+
}
|
839
|
+
}
|
840
|
+
|
841
|
+
bool PickFirst::SubchannelList::AllSubchannelsSeenInitialState() {
|
842
|
+
for (auto& sd : subchannels_) {
|
843
|
+
if (!sd.connectivity_state().has_value()) return false;
|
844
|
+
}
|
845
|
+
return true;
|
846
|
+
}
|
847
|
+
|
571
848
|
//
|
572
849
|
// factory
|
573
850
|
//
|