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
@@ -62,6 +62,8 @@
|
|
62
62
|
#include "src/core/lib/iomgr/iomgr_fwd.h"
|
63
63
|
#include "src/core/lib/iomgr/polling_entity.h"
|
64
64
|
#include "src/core/lib/load_balancing/lb_policy.h"
|
65
|
+
#include "src/core/lib/promise/activity.h"
|
66
|
+
#include "src/core/lib/promise/arena_promise.h"
|
65
67
|
#include "src/core/lib/resolver/resolver.h"
|
66
68
|
#include "src/core/lib/resource_quota/arena.h"
|
67
69
|
#include "src/core/lib/service_config/service_config.h"
|
@@ -102,10 +104,12 @@ namespace grpc_core {
|
|
102
104
|
|
103
105
|
class ClientChannel {
|
104
106
|
public:
|
105
|
-
static const grpc_channel_filter
|
107
|
+
static const grpc_channel_filter kFilterVtableWithPromises;
|
108
|
+
static const grpc_channel_filter kFilterVtableWithoutPromises;
|
106
109
|
|
107
110
|
class LoadBalancedCall;
|
108
111
|
class FilterBasedLoadBalancedCall;
|
112
|
+
class PromiseBasedLoadBalancedCall;
|
109
113
|
|
110
114
|
// Flag that this object gets stored in channel args as a raw pointer.
|
111
115
|
struct RawPointerChannelArgTag {};
|
@@ -115,6 +119,10 @@ class ClientChannel {
|
|
115
119
|
// is not a client channel.
|
116
120
|
static ClientChannel* GetFromChannel(Channel* channel);
|
117
121
|
|
122
|
+
static ArenaPromise<ServerMetadataHandle> MakeCallPromise(
|
123
|
+
grpc_channel_element* elem, CallArgs call_args,
|
124
|
+
NextPromiseFactory next_promise_factory);
|
125
|
+
|
118
126
|
grpc_connectivity_state CheckConnectivityState(bool try_to_connect);
|
119
127
|
|
120
128
|
// Starts a one-time connectivity state watch. When the channel's state
|
@@ -164,6 +172,10 @@ class ClientChannel {
|
|
164
172
|
grpc_closure* on_call_destruction_complete,
|
165
173
|
absl::AnyInvocable<void()> on_commit, bool is_transparent_retry);
|
166
174
|
|
175
|
+
ArenaPromise<ServerMetadataHandle> CreateLoadBalancedCallPromise(
|
176
|
+
CallArgs call_args, absl::AnyInvocable<void()> on_commit,
|
177
|
+
bool is_transparent_retry);
|
178
|
+
|
167
179
|
// Exposed for testing only.
|
168
180
|
static ChannelArgs MakeSubchannelArgs(
|
169
181
|
const ChannelArgs& channel_args, const ChannelArgs& address_args,
|
@@ -173,6 +185,7 @@ class ClientChannel {
|
|
173
185
|
private:
|
174
186
|
class CallData;
|
175
187
|
class FilterBasedCallData;
|
188
|
+
class PromiseBasedCallData;
|
176
189
|
class ResolverResultHandler;
|
177
190
|
class SubchannelWrapper;
|
178
191
|
class ClientChannelControlHelper;
|
@@ -315,8 +328,10 @@ class ClientChannel {
|
|
315
328
|
mutable Mutex lb_mu_;
|
316
329
|
RefCountedPtr<LoadBalancingPolicy::SubchannelPicker> picker_
|
317
330
|
ABSL_GUARDED_BY(lb_mu_);
|
318
|
-
absl::flat_hash_set<LoadBalancedCall
|
319
|
-
|
331
|
+
absl::flat_hash_set<RefCountedPtr<LoadBalancedCall>,
|
332
|
+
RefCountedPtrHash<LoadBalancedCall>,
|
333
|
+
RefCountedPtrEq<LoadBalancedCall>>
|
334
|
+
lb_queued_calls_ ABSL_GUARDED_BY(lb_mu_);
|
320
335
|
|
321
336
|
//
|
322
337
|
// Fields used in the control plane. Guarded by work_serializer.
|
@@ -377,7 +392,7 @@ class ClientChannel::LoadBalancedCall
|
|
377
392
|
bool is_transparent_retry);
|
378
393
|
~LoadBalancedCall() override;
|
379
394
|
|
380
|
-
void Orphan() override;
|
395
|
+
void Orphan() override { Unref(); }
|
381
396
|
|
382
397
|
// Called by channel when removing a call from the list of queued calls.
|
383
398
|
void RemoveCallFromLbQueuedCallsLocked()
|
@@ -394,7 +409,6 @@ class ClientChannel::LoadBalancedCall
|
|
394
409
|
return static_cast<ClientCallTracer::CallAttemptTracer*>(
|
395
410
|
call_context()[GRPC_CONTEXT_CALL_TRACER].value);
|
396
411
|
}
|
397
|
-
gpr_cycle_counter lb_call_start_time() const { return lb_call_start_time_; }
|
398
412
|
ConnectedSubchannel* connected_subchannel() const {
|
399
413
|
return connected_subchannel_.get();
|
400
414
|
}
|
@@ -425,6 +439,8 @@ class ClientChannel::LoadBalancedCall
|
|
425
439
|
grpc_transport_stream_stats* transport_stream_stats,
|
426
440
|
absl::string_view peer_address);
|
427
441
|
|
442
|
+
void RecordLatency();
|
443
|
+
|
428
444
|
private:
|
429
445
|
class LbCallState;
|
430
446
|
class Metadata;
|
@@ -432,7 +448,7 @@ class ClientChannel::LoadBalancedCall
|
|
432
448
|
|
433
449
|
virtual Arena* arena() const = 0;
|
434
450
|
virtual grpc_call_context_element* call_context() const = 0;
|
435
|
-
virtual grpc_polling_entity* pollent()
|
451
|
+
virtual grpc_polling_entity* pollent() = 0;
|
436
452
|
virtual grpc_metadata_batch* send_initial_metadata() const = 0;
|
437
453
|
|
438
454
|
// Helper function for performing an LB pick with a specified picker.
|
@@ -445,7 +461,7 @@ class ClientChannel::LoadBalancedCall
|
|
445
461
|
|
446
462
|
// Called when adding the call to the LB queue.
|
447
463
|
virtual void OnAddToQueueLocked()
|
448
|
-
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::lb_mu_)
|
464
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::lb_mu_) = 0;
|
449
465
|
|
450
466
|
ClientChannel* chand_;
|
451
467
|
|
@@ -496,7 +512,7 @@ class ClientChannel::FilterBasedLoadBalancedCall
|
|
496
512
|
grpc_call_context_element* call_context() const override {
|
497
513
|
return call_context_;
|
498
514
|
}
|
499
|
-
grpc_polling_entity* pollent()
|
515
|
+
grpc_polling_entity* pollent() override { return pollent_; }
|
500
516
|
grpc_metadata_batch* send_initial_metadata() const override {
|
501
517
|
return pending_batches_[0]
|
502
518
|
->payload->send_initial_metadata.send_initial_metadata;
|
@@ -590,6 +606,34 @@ class ClientChannel::FilterBasedLoadBalancedCall
|
|
590
606
|
grpc_transport_stream_op_batch* pending_batches_[MAX_PENDING_BATCHES] = {};
|
591
607
|
};
|
592
608
|
|
609
|
+
class ClientChannel::PromiseBasedLoadBalancedCall
|
610
|
+
: public ClientChannel::LoadBalancedCall {
|
611
|
+
public:
|
612
|
+
PromiseBasedLoadBalancedCall(ClientChannel* chand,
|
613
|
+
absl::AnyInvocable<void()> on_commit,
|
614
|
+
bool is_transparent_retry);
|
615
|
+
|
616
|
+
ArenaPromise<ServerMetadataHandle> MakeCallPromise(
|
617
|
+
CallArgs call_args, OrphanablePtr<PromiseBasedLoadBalancedCall> lb_call);
|
618
|
+
|
619
|
+
private:
|
620
|
+
Arena* arena() const override;
|
621
|
+
grpc_call_context_element* call_context() const override;
|
622
|
+
grpc_polling_entity* pollent() override { return &pollent_; }
|
623
|
+
grpc_metadata_batch* send_initial_metadata() const override;
|
624
|
+
|
625
|
+
void RetryPickLocked() override;
|
626
|
+
|
627
|
+
void OnAddToQueueLocked() override
|
628
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::lb_mu_);
|
629
|
+
|
630
|
+
grpc_polling_entity pollent_;
|
631
|
+
ClientMetadataHandle client_initial_metadata_;
|
632
|
+
Waker waker_;
|
633
|
+
bool was_queued_ = false;
|
634
|
+
Slice peer_string_;
|
635
|
+
};
|
636
|
+
|
593
637
|
} // namespace grpc_core
|
594
638
|
|
595
639
|
#endif // GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H
|
@@ -18,9 +18,14 @@
|
|
18
18
|
|
19
19
|
#include <grpc/support/port_platform.h>
|
20
20
|
|
21
|
+
#include "absl/types/optional.h"
|
22
|
+
|
23
|
+
#include <grpc/impl/channel_arg_names.h>
|
24
|
+
|
21
25
|
#include "src/core/ext/filters/client_channel/client_channel.h"
|
22
26
|
#include "src/core/ext/filters/client_channel/client_channel_service_config.h"
|
23
27
|
#include "src/core/ext/filters/client_channel/retry_service_config.h"
|
28
|
+
#include "src/core/lib/channel/channel_args.h"
|
24
29
|
#include "src/core/lib/channel/channel_stack_builder.h"
|
25
30
|
#include "src/core/lib/config/core_configuration.h"
|
26
31
|
#include "src/core/lib/surface/channel_init.h"
|
@@ -28,13 +33,22 @@
|
|
28
33
|
|
29
34
|
namespace grpc_core {
|
30
35
|
|
36
|
+
namespace {
|
37
|
+
bool IsEverythingBelowClientChannelPromiseSafe(const ChannelArgs& args) {
|
38
|
+
return !args.GetBool(GRPC_ARG_ENABLE_RETRIES).value_or(true);
|
39
|
+
}
|
40
|
+
} // namespace
|
41
|
+
|
31
42
|
void BuildClientChannelConfiguration(CoreConfiguration::Builder* builder) {
|
32
43
|
internal::ClientChannelServiceConfigParser::Register(builder);
|
33
44
|
internal::RetryServiceConfigParser::Register(builder);
|
34
45
|
builder->channel_init()->RegisterStage(
|
35
46
|
GRPC_CLIENT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
|
36
47
|
[](ChannelStackBuilder* builder) {
|
37
|
-
builder->AppendFilter(
|
48
|
+
builder->AppendFilter(
|
49
|
+
IsEverythingBelowClientChannelPromiseSafe(builder->channel_args())
|
50
|
+
? &ClientChannel::kFilterVtableWithPromises
|
51
|
+
: &ClientChannel::kFilterVtableWithoutPromises);
|
38
52
|
return true;
|
39
53
|
});
|
40
54
|
}
|
@@ -99,6 +99,8 @@ class DynamicFilters : public RefCounted<DynamicFilters> {
|
|
99
99
|
|
100
100
|
RefCountedPtr<Call> CreateCall(Call::Args args, grpc_error_handle* error);
|
101
101
|
|
102
|
+
grpc_channel_stack* channel_stack() const { return channel_stack_.get(); }
|
103
|
+
|
102
104
|
private:
|
103
105
|
RefCountedPtr<grpc_channel_stack> channel_stack_;
|
104
106
|
};
|
@@ -16,8 +16,8 @@
|
|
16
16
|
//
|
17
17
|
//
|
18
18
|
|
19
|
-
#ifndef
|
20
|
-
#define
|
19
|
+
#ifndef GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_MAPPER_H
|
20
|
+
#define GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_MAPPER_H
|
21
21
|
|
22
22
|
#include <grpc/support/port_platform.h>
|
23
23
|
|
@@ -49,4 +49,4 @@ void RegisterHttpProxyMapper(CoreConfiguration::Builder* builder);
|
|
49
49
|
|
50
50
|
} // namespace grpc_core
|
51
51
|
|
52
|
-
#endif //
|
52
|
+
#endif // GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_MAPPER_H
|
@@ -0,0 +1,188 @@
|
|
1
|
+
//
|
2
|
+
// Copyright 2015 gRPC authors.
|
3
|
+
//
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
// you may not use this file except in compliance with the License.
|
6
|
+
// You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
// See the License for the specific language governing permissions and
|
14
|
+
// limitations under the License.
|
15
|
+
//
|
16
|
+
|
17
|
+
#include <grpc/support/port_platform.h>
|
18
|
+
|
19
|
+
#include "src/core/ext/filters/client_channel/lb_policy/endpoint_list.h"
|
20
|
+
|
21
|
+
#include <stdlib.h>
|
22
|
+
|
23
|
+
#include <algorithm>
|
24
|
+
#include <memory>
|
25
|
+
#include <utility>
|
26
|
+
#include <vector>
|
27
|
+
|
28
|
+
#include "absl/status/status.h"
|
29
|
+
#include "absl/status/statusor.h"
|
30
|
+
#include "absl/types/optional.h"
|
31
|
+
|
32
|
+
#include <grpc/impl/connectivity_state.h>
|
33
|
+
#include <grpc/support/json.h>
|
34
|
+
#include <grpc/support/log.h>
|
35
|
+
|
36
|
+
#include "src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.h"
|
37
|
+
#include "src/core/lib/channel/channel_args.h"
|
38
|
+
#include "src/core/lib/config/core_configuration.h"
|
39
|
+
#include "src/core/lib/gprpp/debug_location.h"
|
40
|
+
#include "src/core/lib/gprpp/orphanable.h"
|
41
|
+
#include "src/core/lib/gprpp/ref_counted_ptr.h"
|
42
|
+
#include "src/core/lib/iomgr/pollset_set.h"
|
43
|
+
#include "src/core/lib/json/json.h"
|
44
|
+
#include "src/core/lib/load_balancing/delegating_helper.h"
|
45
|
+
#include "src/core/lib/load_balancing/lb_policy.h"
|
46
|
+
#include "src/core/lib/load_balancing/lb_policy_registry.h"
|
47
|
+
#include "src/core/lib/resolver/server_address.h"
|
48
|
+
|
49
|
+
namespace grpc_core {
|
50
|
+
|
51
|
+
//
|
52
|
+
// EndpointList::Endpoint::Helper
|
53
|
+
//
|
54
|
+
|
55
|
+
class EndpointList::Endpoint::Helper
|
56
|
+
: public LoadBalancingPolicy::DelegatingChannelControlHelper {
|
57
|
+
public:
|
58
|
+
explicit Helper(RefCountedPtr<Endpoint> endpoint)
|
59
|
+
: endpoint_(std::move(endpoint)) {}
|
60
|
+
|
61
|
+
~Helper() override { endpoint_.reset(DEBUG_LOCATION, "Helper"); }
|
62
|
+
|
63
|
+
RefCountedPtr<SubchannelInterface> CreateSubchannel(
|
64
|
+
ServerAddress address, const ChannelArgs& args) override {
|
65
|
+
return endpoint_->CreateSubchannel(std::move(address), args);
|
66
|
+
}
|
67
|
+
|
68
|
+
void UpdateState(
|
69
|
+
grpc_connectivity_state state, const absl::Status& status,
|
70
|
+
RefCountedPtr<LoadBalancingPolicy::SubchannelPicker> picker) override {
|
71
|
+
auto old_state = std::exchange(endpoint_->connectivity_state_, state);
|
72
|
+
endpoint_->picker_ = std::move(picker);
|
73
|
+
endpoint_->OnStateUpdate(old_state, state, status);
|
74
|
+
}
|
75
|
+
|
76
|
+
private:
|
77
|
+
LoadBalancingPolicy::ChannelControlHelper* parent_helper() const override {
|
78
|
+
return endpoint_->endpoint_list_->channel_control_helper();
|
79
|
+
}
|
80
|
+
|
81
|
+
RefCountedPtr<Endpoint> endpoint_;
|
82
|
+
};
|
83
|
+
|
84
|
+
//
|
85
|
+
// EndpointList::Endpoint
|
86
|
+
//
|
87
|
+
|
88
|
+
void EndpointList::Endpoint::Init(
|
89
|
+
const ServerAddress& address, const ChannelArgs& args,
|
90
|
+
std::shared_ptr<WorkSerializer> work_serializer) {
|
91
|
+
ChannelArgs child_args =
|
92
|
+
args.Set(GRPC_ARG_INTERNAL_PICK_FIRST_ENABLE_HEALTH_CHECKING, true)
|
93
|
+
.Set(GRPC_ARG_INTERNAL_PICK_FIRST_OMIT_STATUS_MESSAGE_PREFIX, true);
|
94
|
+
LoadBalancingPolicy::Args lb_policy_args;
|
95
|
+
lb_policy_args.work_serializer = std::move(work_serializer);
|
96
|
+
lb_policy_args.args = child_args;
|
97
|
+
lb_policy_args.channel_control_helper =
|
98
|
+
std::make_unique<Helper>(Ref(DEBUG_LOCATION, "Helper"));
|
99
|
+
child_policy_ =
|
100
|
+
CoreConfiguration::Get().lb_policy_registry().CreateLoadBalancingPolicy(
|
101
|
+
"pick_first", std::move(lb_policy_args));
|
102
|
+
if (GPR_UNLIKELY(endpoint_list_->tracer_ != nullptr)) {
|
103
|
+
gpr_log(GPR_INFO, "[%s %p] endpoint %p: created child policy %p",
|
104
|
+
endpoint_list_->tracer_, endpoint_list_->policy_.get(), this,
|
105
|
+
child_policy_.get());
|
106
|
+
}
|
107
|
+
// Add our interested_parties pollset_set to that of the newly created
|
108
|
+
// child policy. This will make the child policy progress upon activity on
|
109
|
+
// this policy, which in turn is tied to the application's call.
|
110
|
+
grpc_pollset_set_add_pollset_set(
|
111
|
+
child_policy_->interested_parties(),
|
112
|
+
endpoint_list_->policy_->interested_parties());
|
113
|
+
// Construct pick_first config.
|
114
|
+
auto config =
|
115
|
+
CoreConfiguration::Get().lb_policy_registry().ParseLoadBalancingConfig(
|
116
|
+
Json::FromArray(
|
117
|
+
{Json::FromObject({{"pick_first", Json::FromObject({})}})}));
|
118
|
+
GPR_ASSERT(config.ok());
|
119
|
+
// Update child policy.
|
120
|
+
LoadBalancingPolicy::UpdateArgs update_args;
|
121
|
+
update_args.addresses.emplace().emplace_back(address);
|
122
|
+
update_args.args = child_args;
|
123
|
+
update_args.config = std::move(*config);
|
124
|
+
// TODO(roth): If the child reports a non-OK status with the update,
|
125
|
+
// we need to propagate that back to the resolver somehow.
|
126
|
+
(void)child_policy_->UpdateLocked(std::move(update_args));
|
127
|
+
}
|
128
|
+
|
129
|
+
void EndpointList::Endpoint::Orphan() {
|
130
|
+
// Remove pollset_set linkage.
|
131
|
+
grpc_pollset_set_del_pollset_set(
|
132
|
+
child_policy_->interested_parties(),
|
133
|
+
endpoint_list_->policy_->interested_parties());
|
134
|
+
child_policy_.reset();
|
135
|
+
picker_.reset();
|
136
|
+
Unref();
|
137
|
+
}
|
138
|
+
|
139
|
+
void EndpointList::Endpoint::ResetBackoffLocked() {
|
140
|
+
if (child_policy_ != nullptr) child_policy_->ResetBackoffLocked();
|
141
|
+
}
|
142
|
+
|
143
|
+
void EndpointList::Endpoint::ExitIdleLocked() {
|
144
|
+
if (child_policy_ != nullptr) child_policy_->ExitIdleLocked();
|
145
|
+
}
|
146
|
+
|
147
|
+
size_t EndpointList::Endpoint::Index() const {
|
148
|
+
for (size_t i = 0; i < endpoint_list_->endpoints_.size(); ++i) {
|
149
|
+
if (endpoint_list_->endpoints_[i].get() == this) return i;
|
150
|
+
}
|
151
|
+
return -1;
|
152
|
+
}
|
153
|
+
|
154
|
+
RefCountedPtr<SubchannelInterface> EndpointList::Endpoint::CreateSubchannel(
|
155
|
+
ServerAddress address, const ChannelArgs& args) {
|
156
|
+
return endpoint_list_->channel_control_helper()->CreateSubchannel(
|
157
|
+
std::move(address), args);
|
158
|
+
}
|
159
|
+
|
160
|
+
//
|
161
|
+
// EndpointList
|
162
|
+
//
|
163
|
+
|
164
|
+
void EndpointList::Init(
|
165
|
+
const ServerAddressList& addresses, const ChannelArgs& args,
|
166
|
+
absl::AnyInvocable<OrphanablePtr<Endpoint>(
|
167
|
+
RefCountedPtr<EndpointList>, const ServerAddress&, const ChannelArgs&)>
|
168
|
+
create_endpoint) {
|
169
|
+
for (const ServerAddress& address : addresses) {
|
170
|
+
endpoints_.push_back(
|
171
|
+
create_endpoint(Ref(DEBUG_LOCATION, "Endpoint"), address, args));
|
172
|
+
}
|
173
|
+
}
|
174
|
+
|
175
|
+
void EndpointList::ResetBackoffLocked() {
|
176
|
+
for (const auto& endpoint : endpoints_) {
|
177
|
+
endpoint->ResetBackoffLocked();
|
178
|
+
}
|
179
|
+
}
|
180
|
+
|
181
|
+
bool EndpointList::AllEndpointsSeenInitialState() const {
|
182
|
+
for (const auto& endpoint : endpoints_) {
|
183
|
+
if (!endpoint->connectivity_state().has_value()) return false;
|
184
|
+
}
|
185
|
+
return true;
|
186
|
+
}
|
187
|
+
|
188
|
+
} // namespace grpc_core
|
@@ -0,0 +1,214 @@
|
|
1
|
+
//
|
2
|
+
// Copyright 2015 gRPC authors.
|
3
|
+
//
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
// you may not use this file except in compliance with the License.
|
6
|
+
// You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
// See the License for the specific language governing permissions and
|
14
|
+
// limitations under the License.
|
15
|
+
//
|
16
|
+
|
17
|
+
#ifndef GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_ENDPOINT_LIST_H
|
18
|
+
#define GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_ENDPOINT_LIST_H
|
19
|
+
|
20
|
+
#include <grpc/support/port_platform.h>
|
21
|
+
|
22
|
+
#include <stdlib.h>
|
23
|
+
|
24
|
+
#include <memory>
|
25
|
+
#include <utility>
|
26
|
+
#include <vector>
|
27
|
+
|
28
|
+
#include "absl/functional/any_invocable.h"
|
29
|
+
#include "absl/status/status.h"
|
30
|
+
#include "absl/types/optional.h"
|
31
|
+
|
32
|
+
#include <grpc/impl/connectivity_state.h>
|
33
|
+
|
34
|
+
#include "src/core/lib/channel/channel_args.h"
|
35
|
+
#include "src/core/lib/gprpp/debug_location.h"
|
36
|
+
#include "src/core/lib/gprpp/orphanable.h"
|
37
|
+
#include "src/core/lib/gprpp/ref_counted_ptr.h"
|
38
|
+
#include "src/core/lib/gprpp/work_serializer.h"
|
39
|
+
#include "src/core/lib/load_balancing/lb_policy.h"
|
40
|
+
#include "src/core/lib/load_balancing/subchannel_interface.h"
|
41
|
+
#include "src/core/lib/resolver/server_address.h"
|
42
|
+
|
43
|
+
namespace grpc_core {
|
44
|
+
|
45
|
+
// A list of endpoints for use in a petiole LB policy. Each endpoint may
|
46
|
+
// have one or more addresses, which will be passed down to a pick_first
|
47
|
+
// child policy.
|
48
|
+
//
|
49
|
+
// To use this, a petiole policy must define its own subclass of both
|
50
|
+
// EndpointList and EndpointList::Endpoint, like so:
|
51
|
+
/*
|
52
|
+
class MyEndpointList : public EndpointList {
|
53
|
+
public:
|
54
|
+
MyEndpointList(RefCountedPtr<MyLbPolicy> lb_policy,
|
55
|
+
const ServerAddressList& addresses, const ChannelArgs& args)
|
56
|
+
: EndpointList(std::move(lb_policy),
|
57
|
+
GRPC_TRACE_FLAG_ENABLED(grpc_my_tracer)
|
58
|
+
? "MyEndpointList"
|
59
|
+
: nullptr) {
|
60
|
+
Init(addresses, args,
|
61
|
+
[&](RefCountedPtr<MyEndpointList> endpoint_list,
|
62
|
+
const ServerAddress& address, const ChannelArgs& args) {
|
63
|
+
return MakeOrphanable<MyEndpoint>(
|
64
|
+
std::move(endpoint_list), address, args,
|
65
|
+
policy<MyLbPolicy>()->work_serializer());
|
66
|
+
});
|
67
|
+
}
|
68
|
+
|
69
|
+
private:
|
70
|
+
class MyEndpoint : public Endpoint {
|
71
|
+
public:
|
72
|
+
MyEndpoint(RefCountedPtr<MyEndpointList> endpoint_list,
|
73
|
+
const ServerAddress& address, const ChannelArgs& args,
|
74
|
+
std::shared_ptr<WorkSerializer> work_serializer)
|
75
|
+
: Endpoint(std::move(endpoint_list)) {
|
76
|
+
Init(address, args, std::move(work_serializer));
|
77
|
+
}
|
78
|
+
|
79
|
+
private:
|
80
|
+
void OnStateUpdate(
|
81
|
+
absl::optional<grpc_connectivity_state> old_state,
|
82
|
+
grpc_connectivity_state new_state,
|
83
|
+
const absl::Status& status) override {
|
84
|
+
// ...handle connectivity state change...
|
85
|
+
}
|
86
|
+
};
|
87
|
+
|
88
|
+
LoadBalancingPolicy::ChannelControlHelper* channel_control_helper()
|
89
|
+
const override {
|
90
|
+
return policy<MyLbPolicy>()->channel_control_helper();
|
91
|
+
}
|
92
|
+
};
|
93
|
+
*/
|
94
|
+
// TODO(roth): Consider wrapping this in an LB policy subclass for petiole
|
95
|
+
// policies to inherit from.
|
96
|
+
class EndpointList : public InternallyRefCounted<EndpointList> {
|
97
|
+
public:
|
98
|
+
// An individual endpoint.
|
99
|
+
class Endpoint : public InternallyRefCounted<Endpoint> {
|
100
|
+
public:
|
101
|
+
~Endpoint() override { endpoint_list_.reset(DEBUG_LOCATION, "Endpoint"); }
|
102
|
+
|
103
|
+
void Orphan() override;
|
104
|
+
|
105
|
+
void ResetBackoffLocked();
|
106
|
+
void ExitIdleLocked();
|
107
|
+
|
108
|
+
absl::optional<grpc_connectivity_state> connectivity_state() const {
|
109
|
+
return connectivity_state_;
|
110
|
+
}
|
111
|
+
RefCountedPtr<LoadBalancingPolicy::SubchannelPicker> picker() const {
|
112
|
+
return picker_;
|
113
|
+
}
|
114
|
+
|
115
|
+
protected:
|
116
|
+
// We use two-phase initialization here to ensure that the vtable is
|
117
|
+
// initialized before we need to use it. Subclass must invoke Init()
|
118
|
+
// from inside its ctor.
|
119
|
+
explicit Endpoint(RefCountedPtr<EndpointList> endpoint_list)
|
120
|
+
: endpoint_list_(std::move(endpoint_list)) {}
|
121
|
+
|
122
|
+
void Init(const ServerAddress& address, const ChannelArgs& args,
|
123
|
+
std::shared_ptr<WorkSerializer> work_serializer);
|
124
|
+
|
125
|
+
// Templated for convenience, to provide a short-hand for
|
126
|
+
// down-casting in the caller.
|
127
|
+
template <typename T>
|
128
|
+
T* endpoint_list() const {
|
129
|
+
return static_cast<T*>(endpoint_list_.get());
|
130
|
+
}
|
131
|
+
|
132
|
+
// Templated for convenience, to provide a short-hand for down-casting
|
133
|
+
// in the caller.
|
134
|
+
template <typename T>
|
135
|
+
T* policy() const {
|
136
|
+
return endpoint_list_->policy<T>();
|
137
|
+
}
|
138
|
+
|
139
|
+
// Returns the index of this endpoint within the EndpointList.
|
140
|
+
// Intended for trace logging.
|
141
|
+
size_t Index() const;
|
142
|
+
|
143
|
+
private:
|
144
|
+
class Helper;
|
145
|
+
|
146
|
+
// Called when the child policy reports a connectivity state update.
|
147
|
+
virtual void OnStateUpdate(
|
148
|
+
absl::optional<grpc_connectivity_state> old_state,
|
149
|
+
grpc_connectivity_state new_state, const absl::Status& status) = 0;
|
150
|
+
|
151
|
+
// Called to create a subchannel. Subclasses may override.
|
152
|
+
virtual RefCountedPtr<SubchannelInterface> CreateSubchannel(
|
153
|
+
ServerAddress address, const ChannelArgs& args);
|
154
|
+
|
155
|
+
RefCountedPtr<EndpointList> endpoint_list_;
|
156
|
+
|
157
|
+
OrphanablePtr<LoadBalancingPolicy> child_policy_;
|
158
|
+
absl::optional<grpc_connectivity_state> connectivity_state_;
|
159
|
+
RefCountedPtr<LoadBalancingPolicy::SubchannelPicker> picker_;
|
160
|
+
};
|
161
|
+
|
162
|
+
~EndpointList() override { policy_.reset(DEBUG_LOCATION, "EndpointList"); }
|
163
|
+
|
164
|
+
void Orphan() override {
|
165
|
+
endpoints_.clear();
|
166
|
+
Unref();
|
167
|
+
}
|
168
|
+
|
169
|
+
size_t size() const { return endpoints_.size(); }
|
170
|
+
|
171
|
+
const std::vector<OrphanablePtr<Endpoint>>& endpoints() const {
|
172
|
+
return endpoints_;
|
173
|
+
}
|
174
|
+
|
175
|
+
void ResetBackoffLocked();
|
176
|
+
|
177
|
+
protected:
|
178
|
+
// We use two-phase initialization here to ensure that the vtable is
|
179
|
+
// initialized before we need to use it. Subclass must invoke Init()
|
180
|
+
// from inside its ctor.
|
181
|
+
EndpointList(RefCountedPtr<LoadBalancingPolicy> policy, const char* tracer)
|
182
|
+
: policy_(std::move(policy)), tracer_(tracer) {}
|
183
|
+
|
184
|
+
void Init(const ServerAddressList& addresses, const ChannelArgs& args,
|
185
|
+
absl::AnyInvocable<OrphanablePtr<Endpoint>(
|
186
|
+
RefCountedPtr<EndpointList>, const ServerAddress&,
|
187
|
+
const ChannelArgs&)>
|
188
|
+
create_endpoint);
|
189
|
+
|
190
|
+
// Templated for convenience, to provide a short-hand for down-casting
|
191
|
+
// in the caller.
|
192
|
+
template <typename T>
|
193
|
+
T* policy() const {
|
194
|
+
return static_cast<T*>(policy_.get());
|
195
|
+
}
|
196
|
+
|
197
|
+
// Returns true if all endpoints have seen their initial connectivity
|
198
|
+
// state notification.
|
199
|
+
bool AllEndpointsSeenInitialState() const;
|
200
|
+
|
201
|
+
private:
|
202
|
+
// Returns the parent policy's helper. Needed because the accessor
|
203
|
+
// method is protected on LoadBalancingPolicy.
|
204
|
+
virtual LoadBalancingPolicy::ChannelControlHelper* channel_control_helper()
|
205
|
+
const = 0;
|
206
|
+
|
207
|
+
RefCountedPtr<LoadBalancingPolicy> policy_;
|
208
|
+
const char* tracer_;
|
209
|
+
std::vector<OrphanablePtr<Endpoint>> endpoints_;
|
210
|
+
};
|
211
|
+
|
212
|
+
} // namespace grpc_core
|
213
|
+
|
214
|
+
#endif // GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_ENDPOINT_LIST_H
|
@@ -107,6 +107,7 @@
|
|
107
107
|
#include "src/core/lib/channel/channelz.h"
|
108
108
|
#include "src/core/lib/config/core_configuration.h"
|
109
109
|
#include "src/core/lib/debug/trace.h"
|
110
|
+
#include "src/core/lib/experiments/experiments.h"
|
110
111
|
#include "src/core/lib/gpr/string.h"
|
111
112
|
#include "src/core/lib/gpr/useful.h"
|
112
113
|
#include "src/core/lib/gprpp/crash.h"
|
@@ -318,10 +319,22 @@ class GrpcLb : public LoadBalancingPolicy {
|
|
318
319
|
lb_token_(std::move(lb_token)),
|
319
320
|
client_stats_(std::move(client_stats)) {}
|
320
321
|
|
321
|
-
|
322
|
-
if (!
|
323
|
-
lb_policy_->
|
322
|
+
void Orphan() override {
|
323
|
+
if (!IsWorkSerializerDispatchEnabled()) {
|
324
|
+
if (!lb_policy_->shutting_down_) {
|
325
|
+
lb_policy_->CacheDeletedSubchannelLocked(wrapped_subchannel());
|
326
|
+
}
|
327
|
+
return;
|
324
328
|
}
|
329
|
+
WeakRefCountedPtr<SubchannelWrapper> self = WeakRef();
|
330
|
+
lb_policy_->work_serializer()->Run(
|
331
|
+
[self = std::move(self)]() {
|
332
|
+
if (!self->lb_policy_->shutting_down_) {
|
333
|
+
self->lb_policy_->CacheDeletedSubchannelLocked(
|
334
|
+
self->wrapped_subchannel());
|
335
|
+
}
|
336
|
+
},
|
337
|
+
DEBUG_LOCATION);
|
325
338
|
}
|
326
339
|
|
327
340
|
const std::string& lb_token() const { return lb_token_; }
|
@@ -1588,7 +1601,7 @@ absl::Status GrpcLb::UpdateBalancerChannelLocked() {
|
|
1588
1601
|
// Pass channel creds via channel args, since the fake resolver won't
|
1589
1602
|
// do this automatically.
|
1590
1603
|
result.args = lb_channel_args.SetObject(std::move(channel_credentials));
|
1591
|
-
response_generator_->
|
1604
|
+
response_generator_->SetResponseAsync(std::move(result));
|
1592
1605
|
// Return status.
|
1593
1606
|
return status;
|
1594
1607
|
}
|