grpc 1.78.0 → 1.80.0.pre1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Makefile +22 -8
- data/include/grpc/credentials.h +47 -37
- data/include/grpc/credentials_cpp.h +39 -0
- data/include/grpc/event_engine/event_engine.h +8 -3
- data/include/grpc/grpc.h +4 -0
- data/include/grpc/impl/call.h +9 -0
- data/include/grpc/impl/channel_arg_names.h +7 -0
- data/include/grpc/module.modulemap +2 -0
- data/include/grpc/private_key_signer.h +104 -0
- data/include/grpc/support/port_platform.h +6 -0
- data/src/core/call/call_filters.h +101 -78
- data/src/core/call/call_spine.h +91 -68
- data/src/core/call/call_state.h +60 -4
- data/src/core/call/client_call.cc +9 -9
- data/src/core/call/client_call.h +1 -1
- data/src/core/call/metadata_batch.cc +2 -0
- data/src/core/call/metadata_batch.h +48 -1
- data/src/core/call/metadata_info.cc +35 -0
- data/src/core/call/metadata_info.h +2 -0
- data/src/core/call/simple_slice_based_metadata.h +2 -1
- data/src/core/channelz/channelz.cc +9 -6
- data/src/core/channelz/channelz.h +7 -4
- data/src/core/channelz/property_list.h +5 -0
- data/src/core/channelz/v2tov1/convert.cc +1 -1
- data/src/core/channelz/v2tov1/legacy_api.cc +164 -307
- data/src/core/client_channel/buffered_call.cc +7 -3
- data/src/core/client_channel/buffered_call.h +11 -5
- data/src/core/client_channel/client_channel.cc +106 -44
- data/src/core/client_channel/client_channel.h +3 -6
- data/src/core/client_channel/client_channel_filter.cc +90 -64
- data/src/core/client_channel/client_channel_filter.h +3 -6
- data/src/core/client_channel/client_channel_internal.h +5 -0
- data/src/core/client_channel/config_selector.h +17 -12
- data/src/core/client_channel/dynamic_filters.cc +8 -7
- data/src/core/client_channel/dynamic_filters.h +7 -5
- data/src/core/client_channel/retry_filter.cc +1 -1
- data/src/core/client_channel/retry_filter.h +2 -2
- data/src/core/client_channel/subchannel.cc +1682 -266
- data/src/core/client_channel/subchannel.h +411 -134
- data/src/core/client_channel/subchannel_stream_client.cc +22 -18
- data/src/core/client_channel/subchannel_stream_client.h +8 -9
- data/src/core/client_channel/subchannel_stream_limiter.cc +76 -0
- data/src/core/client_channel/subchannel_stream_limiter.h +51 -0
- data/src/core/config/config_vars.cc +9 -1
- data/src/core/config/config_vars.h +6 -0
- data/src/core/credentials/call/call_creds_registry.h +51 -22
- data/src/core/credentials/call/call_creds_registry_init.cc +86 -2
- data/src/core/credentials/call/external/aws_external_account_credentials.cc +2 -2
- data/src/core/credentials/call/external/external_account_credentials.cc +11 -4
- data/src/core/credentials/call/external/file_external_account_credentials.cc +2 -2
- data/src/core/credentials/transport/channel_creds_registry.h +71 -20
- data/src/core/credentials/transport/channel_creds_registry_init.cc +338 -29
- data/src/core/credentials/transport/ssl/ssl_credentials.cc +43 -24
- data/src/core/credentials/transport/ssl/ssl_credentials.h +7 -1
- data/src/core/credentials/transport/ssl/ssl_security_connector.cc +2 -8
- data/src/core/credentials/transport/ssl/ssl_security_connector.h +4 -3
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.cc +25 -5
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.h +7 -5
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.cc +181 -109
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.h +55 -42
- data/src/core/credentials/transport/tls/grpc_tls_credentials_options.cc +28 -23
- data/src/core/credentials/transport/tls/grpc_tls_credentials_options.h +26 -23
- data/src/core/credentials/transport/tls/spiffe_utils.cc +2 -2
- data/src/core/credentials/transport/tls/ssl_utils.cc +18 -18
- data/src/core/credentials/transport/tls/ssl_utils.h +12 -10
- data/src/core/credentials/transport/tls/tls_security_connector.cc +106 -74
- data/src/core/credentials/transport/tls/tls_security_connector.h +12 -8
- data/src/core/credentials/transport/xds/xds_credentials.cc +76 -32
- data/src/core/credentials/transport/xds/xds_credentials.h +4 -2
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +117 -35
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +42 -4
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +58 -29
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.h +19 -11
- data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +82 -25
- data/src/core/ext/filters/stateful_session/stateful_session_filter.h +28 -3
- data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.cc +9 -7
- data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h +1 -1
- data/src/core/ext/transport/chttp2/transport/call_tracer_wrapper.h +7 -1
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +117 -67
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +2 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.h +11 -1
- data/src/core/ext/transport/chttp2/transport/frame.cc +2 -15
- data/src/core/ext/transport/chttp2/transport/frame.h +0 -4
- data/src/core/ext/transport/chttp2/transport/goaway.cc +17 -2
- data/src/core/ext/transport/chttp2/transport/goaway.h +27 -6
- data/src/core/ext/transport/chttp2/transport/header_assembler.h +8 -21
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +101 -40
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +95 -0
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +923 -772
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +406 -423
- data/src/core/ext/transport/chttp2/transport/http2_settings.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +8 -1
- data/src/core/ext/transport/chttp2/transport/http2_settings_promises.h +25 -13
- data/src/core/ext/transport/chttp2/transport/http2_transport.cc +71 -24
- data/src/core/ext/transport/chttp2/transport/http2_transport.h +25 -49
- data/src/core/ext/transport/chttp2/transport/http2_ztrace_collector.h +2 -2
- data/src/core/ext/transport/chttp2/transport/incoming_metadata_tracker.h +29 -9
- data/src/core/ext/transport/chttp2/transport/internal.h +6 -2
- data/src/core/ext/transport/chttp2/transport/keepalive.cc +14 -20
- data/src/core/ext/transport/chttp2/transport/keepalive.h +9 -6
- data/src/core/ext/transport/chttp2/transport/parsing.cc +11 -0
- data/src/core/ext/transport/chttp2/transport/ping_promise.cc +34 -74
- data/src/core/ext/transport/chttp2/transport/ping_promise.h +123 -79
- data/src/core/ext/transport/chttp2/transport/security_frame.h +233 -3
- data/src/core/ext/transport/chttp2/transport/stream.h +152 -73
- data/src/core/ext/transport/chttp2/transport/stream_data_queue.h +155 -85
- data/src/core/ext/transport/chttp2/transport/transport_common.h +0 -5
- data/src/core/ext/transport/chttp2/transport/writable_streams.h +8 -7
- data/src/core/ext/transport/chttp2/transport/write_cycle.cc +86 -0
- data/src/core/ext/transport/chttp2/transport/write_cycle.h +355 -0
- data/src/core/ext/transport/chttp2/transport/writing.cc +31 -29
- data/src/core/ext/upb-gen/cel/expr/checked.upb.h +1875 -0
- data/src/core/ext/upb-gen/cel/expr/checked.upb_minitable.c +409 -0
- data/src/core/ext/upb-gen/cel/expr/checked.upb_minitable.h +56 -0
- data/src/core/ext/upb-gen/cel/expr/syntax.upb.h +2223 -0
- data/src/core/ext/upb-gen/cel/expr/syntax.upb_minitable.c +489 -0
- data/src/core/ext/upb-gen/cel/expr/syntax.upb_minitable.h +60 -0
- data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb.h +2 -1
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb.h +130 -18
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.c +18 -13
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb.h +70 -38
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.c +20 -17
- data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb.h +26 -10
- data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb_minitable.c +8 -7
- data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb.h +495 -0
- data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb_minitable.c +114 -0
- data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb_minitable.h +36 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb.h +26 -10
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb_minitable.c +8 -7
- data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb.h +121 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb_minitable.c +54 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb_minitable.h +32 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb.h +143 -9
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb_minitable.c +18 -6
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb.h +112 -11
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.c +22 -9
- data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb.h +276 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb_minitable.c +60 -5
- data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb_minitable.h +4 -0
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb.h +72 -0
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.c +23 -2
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb.h +129 -13
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.c +36 -10
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb.h +30 -0
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb_minitable.c +5 -3
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb.h +16 -0
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb_minitable.c +4 -3
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb.h +31 -0
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb_minitable.c +5 -3
- data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb.h +2 -1
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb.h +63 -0
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb_minitable.c +12 -7
- data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb.h +97 -81
- data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb_minitable.c +40 -23
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb.h +604 -228
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.c +146 -100
- data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb.h +30 -0
- data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb_minitable.c +5 -3
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb.h +35 -3
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb_minitable.c +7 -4
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb.h +66 -14
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb_minitable.c +22 -11
- data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +87 -0
- data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.c +29 -2
- data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +0 -1
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c +0 -1
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +20 -4
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c +5 -4
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +239 -60
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.c +59 -28
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb.h +89 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb_minitable.c +50 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb_minitable.h +32 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb.h +135 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb_minitable.c +53 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb_minitable.h +32 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb.h +105 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb_minitable.c +51 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb_minitable.h +32 -0
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +32 -0
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb_minitable.c +6 -3
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +206 -0
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.c +41 -8
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb.h +64 -0
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb_minitable.c +4 -3
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +64 -0
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb_minitable.c +31 -5
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb.h +283 -14
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.c +48 -11
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb.h +144 -6
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.c +35 -7
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb.h +42 -21
- data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb_minitable.c +9 -8
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb.h +164 -1
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.c +37 -6
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb.h +0 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb_minitable.c +0 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb.h +0 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb_minitable.c +0 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb.h +26 -11
- data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb_minitable.c +8 -8
- data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb.h +33 -0
- data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb_minitable.c +14 -3
- data/src/core/ext/upb-gen/xds/type/v3/cel.upb.h +90 -10
- data/src/core/ext/upb-gen/xds/type/v3/cel.upb_minitable.c +18 -7
- data/src/core/ext/upbdefs-gen/cel/expr/checked.upbdefs.c +248 -0
- data/src/core/ext/upbdefs-gen/cel/expr/checked.upbdefs.h +97 -0
- data/src/core/ext/upbdefs-gen/cel/expr/syntax.upbdefs.c +283 -0
- data/src/core/ext/upbdefs-gen/cel/expr/syntax.upbdefs.h +107 -0
- data/src/core/ext/upbdefs-gen/envoy/config/accesslog/v3/accesslog.upbdefs.c +213 -211
- data/src/core/ext/upbdefs-gen/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +635 -614
- data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/cluster.upbdefs.c +1012 -1000
- data/src/core/ext/upbdefs-gen/envoy/config/common/matcher/v3/matcher.upbdefs.c +276 -273
- data/src/core/ext/upbdefs-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upbdefs.c +152 -0
- data/src/core/ext/upbdefs-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upbdefs.h +47 -0
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/address.upbdefs.c +149 -144
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/base.upbdefs.c +367 -370
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/cel.upbdefs.c +63 -0
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/cel.upbdefs.h +37 -0
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/grpc_service.upbdefs.c +297 -284
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/protocol.upbdefs.c +492 -469
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/proxy_protocol.upbdefs.c +74 -43
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/proxy_protocol.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/substitution_format_string.upbdefs.c +60 -59
- data/src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +202 -184
- data/src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener.upbdefs.c +354 -339
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/quic_config.upbdefs.c +28 -19
- data/src/core/ext/upbdefs-gen/envoy/config/metrics/v3/metrics_service.upbdefs.c +30 -27
- data/src/core/ext/upbdefs-gen/envoy/config/metrics/v3/stats.upbdefs.c +71 -66
- data/src/core/ext/upbdefs-gen/envoy/config/overload/v3/overload.upbdefs.c +94 -91
- data/src/core/ext/upbdefs-gen/envoy/config/rbac/v3/rbac.upbdefs.c +386 -369
- data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route.upbdefs.c +60 -57
- data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route_components.upbdefs.c +1974 -1884
- data/src/core/ext/upbdefs-gen/envoy/config/tap/v3/common.upbdefs.c +119 -112
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/opentelemetry.upbdefs.c +62 -51
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/zipkin.upbdefs.c +109 -88
- data/src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +54 -36
- data/src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c +78 -84
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c +48 -46
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +1041 -984
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +304 -290
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +94 -77
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upbdefs.c +246 -193
- data/src/core/ext/upbdefs-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/type/http/v3/cookie.upbdefs.c +37 -23
- data/src/core/ext/upbdefs-gen/envoy/type/http/v3/cookie.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/type/tracing/v3/custom_tag.upbdefs.c +5 -3
- data/src/core/ext/upbdefs-gen/google/api/http.upbdefs.c +4 -4
- data/src/core/ext/upbdefs-gen/google/api/httpbody.upbdefs.c +4 -5
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.c +113 -87
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/udpa/annotations/migrate.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-gen/udpa/annotations/security.upbdefs.c +6 -5
- data/src/core/ext/upbdefs-gen/udpa/annotations/sensitive.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-gen/udpa/annotations/status.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-gen/udpa/annotations/versioning.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/cel.upbdefs.c +25 -30
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/http_inputs.upbdefs.c +14 -20
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/matcher.upbdefs.c +180 -183
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/string.upbdefs.c +56 -47
- data/src/core/ext/upbdefs-gen/xds/type/v3/cel.upbdefs.c +69 -47
- data/src/core/filter/filter_chain.h +95 -0
- data/src/core/handshaker/http_connect/{http_connect_handshaker.cc → http_connect_client_handshaker.cc} +32 -31
- data/src/core/handshaker/http_connect/{http_connect_handshaker.h → http_connect_client_handshaker.h} +4 -4
- data/src/core/handshaker/http_connect/http_proxy_mapper.cc +1 -1
- data/src/core/handshaker/http_connect/xds_http_proxy_mapper.cc +1 -1
- data/src/core/handshaker/security/pipelined_secure_endpoint.cc +14 -13
- data/src/core/handshaker/security/secure_endpoint.cc +282 -68
- data/src/core/handshaker/security/secure_endpoint.h +0 -7
- data/src/core/lib/channel/channel_args.h +1 -1
- data/src/core/lib/channel/promise_based_filter.cc +17 -4
- data/src/core/lib/channel/promise_based_filter.h +3 -2
- data/src/core/lib/debug/trace_flags.cc +2 -0
- data/src/core/lib/debug/trace_flags.h +1 -0
- data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +35 -8
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.h +1 -2
- data/src/core/lib/event_engine/event_engine.cc +9 -0
- data/src/core/lib/event_engine/extensions/tcp_trace.h +0 -3
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +2 -2
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +1 -1
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +34 -9
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +24 -2
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +1 -3
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +141 -14
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +19 -2
- data/src/core/lib/event_engine/posix_engine/posix_interface.h +7 -0
- data/src/core/lib/event_engine/posix_engine/posix_interface_posix.cc +21 -3
- data/src/core/lib/event_engine/posix_engine/posix_interface_windows.cc +16 -0
- data/src/core/lib/experiments/experiments.cc +309 -201
- data/src/core/lib/experiments/experiments.h +141 -80
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +2 -2
- data/src/core/lib/iomgr/resolve_address.h +0 -2
- data/src/core/lib/iomgr/resolved_address.h +0 -2
- data/src/core/lib/iomgr/tcp_posix.cc +13 -5
- data/src/core/lib/iomgr/tcp_server.cc +0 -5
- data/src/core/lib/iomgr/tcp_server.h +0 -7
- data/src/core/lib/iomgr/tcp_server_posix.cc +0 -17
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +0 -3
- data/src/core/lib/iomgr/tcp_server_windows.cc +12 -51
- data/src/core/lib/promise/all_ok.h +17 -12
- data/src/core/lib/promise/cancel_callback.h +12 -13
- data/src/core/lib/promise/detail/join_state.h +626 -0
- data/src/core/lib/promise/detail/promise_factory.h +14 -14
- data/src/core/lib/promise/for_each.h +32 -8
- data/src/core/lib/promise/if.h +9 -7
- data/src/core/lib/promise/loop.h +18 -16
- data/src/core/lib/promise/map.h +54 -47
- data/src/core/lib/promise/mpsc.h +11 -10
- data/src/core/lib/promise/observable.h +6 -6
- data/src/core/lib/promise/party.h +25 -19
- data/src/core/lib/promise/poll.h +5 -5
- data/src/core/lib/promise/prioritized_race.h +10 -7
- data/src/core/lib/promise/promise.h +16 -11
- data/src/core/lib/promise/race.h +6 -5
- data/src/core/lib/promise/seq.h +109 -74
- data/src/core/lib/promise/try_join.h +14 -6
- data/src/core/lib/promise/try_seq.h +76 -60
- data/src/core/lib/resource_quota/api.cc +7 -0
- data/src/core/lib/resource_quota/arena.h +1 -1
- data/src/core/lib/resource_quota/memory_quota.cc +4 -1
- data/src/core/lib/resource_quota/resource_quota.cc +2 -1
- data/src/core/lib/resource_quota/resource_quota.h +3 -0
- data/src/core/lib/resource_quota/stream_quota.cc +77 -1
- data/src/core/lib/resource_quota/stream_quota.h +64 -1
- data/src/core/lib/resource_quota/telemetry.h +1 -1
- data/src/core/lib/surface/call.cc +13 -0
- data/src/core/lib/surface/call_utils.h +58 -43
- data/src/core/lib/surface/channel.h +1 -4
- data/src/core/lib/surface/completion_queue.cc +13 -6
- data/src/core/lib/surface/validate_metadata.cc +20 -15
- data/src/core/lib/surface/validate_metadata.h +3 -1
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/promise_endpoint.cc +1 -1
- data/src/core/lib/transport/promise_endpoint.h +1 -1
- data/src/core/lib/transport/transport.h +5 -0
- data/src/core/load_balancing/health_check_client.cc +1 -15
- data/src/core/load_balancing/health_check_client_internal.h +0 -2
- data/src/core/load_balancing/oob_backend_metric.cc +1 -5
- data/src/core/load_balancing/oob_backend_metric_internal.h +0 -1
- data/src/core/load_balancing/xds/xds_cluster_impl.cc +12 -9
- data/src/core/plugin_registry/grpc_plugin_registry.cc +3 -2
- data/src/core/resolver/xds/xds_resolver.cc +162 -116
- data/src/core/server/server.cc +18 -1
- data/src/core/server/server.h +2 -0
- data/src/core/server/xds_server_config_fetcher.cc +4 -4
- data/src/core/telemetry/call_tracer.cc +87 -2
- data/src/core/telemetry/call_tracer.h +46 -8
- data/src/core/telemetry/instrument.cc +102 -40
- data/src/core/telemetry/instrument.h +246 -65
- data/src/core/tsi/fake_transport_security.cc +3 -1
- data/src/core/tsi/ssl_transport_security.cc +516 -137
- data/src/core/tsi/ssl_transport_security.h +28 -22
- data/src/core/tsi/ssl_transport_security_utils.cc +2 -2
- data/src/core/tsi/ssl_transport_security_utils.h +2 -2
- data/src/core/util/bitset.h +6 -0
- data/src/core/util/function_signature.h +3 -1
- data/src/core/util/http_client/httpcli_security_connector.cc +2 -1
- data/src/core/util/json/json_reader.cc +0 -4
- data/src/core/xds/grpc/certificate_provider_store.cc +2 -1
- data/src/core/xds/grpc/certificate_provider_store.h +3 -17
- data/src/core/xds/grpc/certificate_provider_store_interface.h +61 -0
- data/src/core/xds/grpc/xds_bootstrap_grpc.cc +48 -0
- data/src/core/xds/grpc/xds_bootstrap_grpc.h +18 -0
- data/src/core/xds/grpc/xds_certificate_provider.cc +7 -2
- data/src/core/xds/grpc/xds_certificate_provider.h +13 -2
- data/src/core/xds/grpc/xds_client_grpc.cc +13 -6
- data/src/core/xds/grpc/xds_client_grpc.h +10 -7
- data/src/core/xds/grpc/xds_cluster.cc +18 -4
- data/src/core/xds/grpc/xds_cluster.h +17 -2
- data/src/core/xds/grpc/xds_cluster_parser.cc +36 -11
- data/src/core/xds/grpc/xds_common_types.cc +45 -0
- data/src/core/xds/grpc/xds_common_types.h +31 -0
- data/src/core/xds/grpc/xds_common_types_parser.cc +274 -16
- data/src/core/xds/grpc/xds_common_types_parser.h +12 -0
- data/src/core/xds/grpc/xds_http_fault_filter.cc +128 -24
- data/src/core/xds/grpc/xds_http_fault_filter.h +19 -10
- data/src/core/xds/grpc/xds_http_filter.cc +38 -0
- data/src/core/xds/grpc/xds_http_filter.h +70 -47
- data/src/core/xds/grpc/xds_http_filter_registry.cc +48 -14
- data/src/core/xds/grpc/xds_http_filter_registry.h +29 -15
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.cc +88 -22
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.h +22 -11
- data/src/core/xds/grpc/xds_http_rbac_filter.cc +36 -20
- data/src/core/xds/grpc/xds_http_rbac_filter.h +19 -10
- data/src/core/xds/grpc/xds_http_stateful_session_filter.cc +143 -26
- data/src/core/xds/grpc/xds_http_stateful_session_filter.h +19 -10
- data/src/core/xds/grpc/xds_listener.cc +4 -1
- data/src/core/xds/grpc/xds_listener.h +10 -2
- data/src/core/xds/grpc/xds_listener_parser.cc +23 -18
- data/src/core/xds/grpc/xds_matcher.cc +40 -5
- data/src/core/xds/grpc/xds_matcher.h +13 -0
- data/src/core/xds/grpc/xds_matcher_action.h +1 -1
- data/src/core/xds/grpc/xds_matcher_parse.cc +60 -40
- data/src/core/xds/grpc/xds_matcher_parse.h +2 -1
- data/src/core/xds/grpc/xds_route_config.cc +12 -1
- data/src/core/xds/grpc/xds_route_config.h +15 -2
- data/src/core/xds/grpc/xds_route_config_parser.cc +11 -5
- data/src/core/xds/grpc/xds_routing.cc +181 -6
- data/src/core/xds/grpc/xds_routing.h +57 -0
- data/src/core/xds/grpc/xds_server_grpc.cc +55 -43
- data/src/core/xds/grpc/xds_server_grpc.h +13 -6
- data/src/core/xds/grpc/xds_server_grpc_interface.h +3 -2
- data/src/core/xds/grpc/xds_transport_grpc.cc +12 -6
- data/src/core/xds/grpc/xds_transport_grpc.h +5 -1
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +12 -8
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +18 -12
- data/src/ruby/lib/grpc/grpc.rb +7 -9
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/generate_proto_ruby.sh +1 -1
- data/src/ruby/spec/client_server_spec.rb +1 -1
- data/src/ruby/spec/generic/rpc_server_pool_spec.rb +1 -1
- data/src/ruby/spec/generic/rpc_server_spec.rb +3 -4
- data/src/ruby/spec/spec_helper.rb +1 -1
- metadata +64 -14
- data/src/core/ext/transport/chttp2/transport/security_frame.cc +0 -31
- data/src/core/handshaker/security/legacy_secure_endpoint.cc +0 -597
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
#include "src/core/lib/promise/if.h"
|
|
24
24
|
#include "src/core/lib/promise/loop.h"
|
|
25
25
|
#include "src/core/lib/promise/party.h"
|
|
26
|
+
#include "src/core/lib/promise/promise.h"
|
|
26
27
|
#include "src/core/lib/promise/race.h"
|
|
27
28
|
#include "src/core/lib/promise/sleep.h"
|
|
28
29
|
#include "src/core/lib/promise/try_seq.h"
|
|
@@ -33,12 +34,10 @@ namespace grpc_core {
|
|
|
33
34
|
namespace http2 {
|
|
34
35
|
KeepaliveManager::KeepaliveManager(
|
|
35
36
|
std::unique_ptr<KeepAliveInterface> keep_alive_interface,
|
|
36
|
-
Duration keepalive_timeout, const Duration keepalive_time
|
|
37
|
+
Duration keepalive_timeout, const Duration keepalive_time)
|
|
37
38
|
: keep_alive_interface_(std::move(keep_alive_interface)),
|
|
38
39
|
keepalive_timeout_(keepalive_timeout),
|
|
39
|
-
keepalive_time_(keepalive_time) {
|
|
40
|
-
MaybeSpawnKeepaliveLoop(party);
|
|
41
|
-
}
|
|
40
|
+
keepalive_time_(keepalive_time) {}
|
|
42
41
|
|
|
43
42
|
auto KeepaliveManager::WaitForKeepAliveTimeout() {
|
|
44
43
|
return AssertResultType<absl::Status>(
|
|
@@ -90,23 +89,18 @@ auto KeepaliveManager::MaybeSendKeepAlivePing() {
|
|
|
90
89
|
}));
|
|
91
90
|
}
|
|
92
91
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
keep_alive_spawned_ = true;
|
|
92
|
+
bool KeepaliveManager::IsKeepAliveLoopNeeded() {
|
|
93
|
+
return IsKeepAliveNeeded() && !keep_alive_spawned_;
|
|
94
|
+
}
|
|
99
95
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
<< status;
|
|
109
|
-
});
|
|
96
|
+
Promise<absl::Status> KeepaliveManager::KeepaliveLoop() {
|
|
97
|
+
GRPC_HTTP2_KEEPALIVE_LOG << "KeepaliveManager::KeepaliveLoop Spawning.";
|
|
98
|
+
keep_alive_spawned_ = true;
|
|
99
|
+
return Loop([this]() {
|
|
100
|
+
return TrySeq(
|
|
101
|
+
Sleep(keepalive_time_), [this]() { return MaybeSendKeepAlivePing(); },
|
|
102
|
+
[]() -> LoopCtl<absl::Status> { return Continue(); });
|
|
103
|
+
});
|
|
110
104
|
}
|
|
111
105
|
} // namespace http2
|
|
112
106
|
} // namespace grpc_core
|
|
@@ -18,8 +18,10 @@
|
|
|
18
18
|
#ifndef GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_KEEPALIVE_H
|
|
19
19
|
#define GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_KEEPALIVE_H
|
|
20
20
|
|
|
21
|
+
#include "src/core/lib/promise/loop.h"
|
|
21
22
|
#include "src/core/lib/promise/party.h"
|
|
22
23
|
#include "src/core/lib/promise/promise.h"
|
|
24
|
+
#include "src/core/lib/promise/sleep.h"
|
|
23
25
|
#include "src/core/util/grpc_check.h"
|
|
24
26
|
#include "absl/status/status.h"
|
|
25
27
|
|
|
@@ -45,8 +47,7 @@ class KeepAliveInterface {
|
|
|
45
47
|
class KeepaliveManager {
|
|
46
48
|
public:
|
|
47
49
|
KeepaliveManager(std::unique_ptr<KeepAliveInterface> keep_alive_interface,
|
|
48
|
-
Duration keepalive_timeout, Duration keepalive_time
|
|
49
|
-
Party* party);
|
|
50
|
+
Duration keepalive_timeout, Duration keepalive_time);
|
|
50
51
|
|
|
51
52
|
// Needs to be called when any data is read from the endpoint.
|
|
52
53
|
void GotData() {
|
|
@@ -66,11 +67,13 @@ class KeepaliveManager {
|
|
|
66
67
|
keepalive_timeout_ = keepalive_timeout;
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
//
|
|
72
|
-
|
|
70
|
+
bool IsKeepAliveLoopNeeded();
|
|
71
|
+
|
|
72
|
+
// Returns a promise that processes keepalive pings. This MUST be called at
|
|
73
|
+
// most once during the lifetime of the keepalive manager.
|
|
74
|
+
Promise<absl::Status> KeepaliveLoop();
|
|
73
75
|
|
|
76
|
+
private:
|
|
74
77
|
// Returns a promise that sleeps for the keepalive_timeout_ and triggers the
|
|
75
78
|
// keepalive timeout unless data is read within the keepalive timeout.
|
|
76
79
|
auto WaitForKeepAliveTimeout();
|
|
@@ -754,6 +754,17 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
|
|
|
754
754
|
GRPC_CHTTP2_IF_TRACING(ERROR) << "grpc_chttp2_stream not accepted";
|
|
755
755
|
return init_header_skip_frame_parser(t, priority_type, is_eoh);
|
|
756
756
|
}
|
|
757
|
+
|
|
758
|
+
uint32_t current_open_streams = t->stream_map.size() + t->extra_streams;
|
|
759
|
+
if (t->max_concurrent_streams_overload_protection) {
|
|
760
|
+
current_open_streams =
|
|
761
|
+
t->streams_allocated.load(std::memory_order_relaxed);
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
t->settings.mutable_local().UpdateMaxConcurrentStreams(
|
|
765
|
+
t->stream_quota->GetConnectionMaxConcurrentRequests(
|
|
766
|
+
current_open_streams));
|
|
767
|
+
|
|
757
768
|
if (GRPC_TRACE_FLAG_ENABLED(http) ||
|
|
758
769
|
GRPC_TRACE_FLAG_ENABLED(chttp2_new_stream)) {
|
|
759
770
|
LOG(INFO) << "[t:" << t << " fd:" << grpc_endpoint_get_fd(t->ep.get())
|
|
@@ -17,31 +17,33 @@
|
|
|
17
17
|
//
|
|
18
18
|
#include "src/core/ext/transport/chttp2/transport/ping_promise.h"
|
|
19
19
|
|
|
20
|
+
#include <cstdint>
|
|
20
21
|
#include <memory>
|
|
22
|
+
#include <optional>
|
|
21
23
|
#include <utility>
|
|
24
|
+
#include <vector>
|
|
22
25
|
|
|
26
|
+
#include "src/core/ext/transport/chttp2/transport/frame.h"
|
|
27
|
+
#include "src/core/ext/transport/chttp2/transport/ping_rate_policy.h"
|
|
28
|
+
#include "src/core/ext/transport/chttp2/transport/write_cycle.h"
|
|
23
29
|
#include "src/core/lib/channel/channel_args.h"
|
|
24
30
|
#include "src/core/lib/promise/latch.h"
|
|
25
31
|
#include "src/core/lib/promise/map.h"
|
|
26
|
-
#include "src/core/lib/promise/
|
|
27
|
-
#include "src/core/lib/promise/
|
|
28
|
-
#include "src/core/lib/
|
|
29
|
-
#include "src/core/lib/promise/try_seq.h"
|
|
32
|
+
#include "src/core/lib/promise/poll.h"
|
|
33
|
+
#include "src/core/lib/promise/promise.h"
|
|
34
|
+
#include "src/core/lib/slice/slice_buffer.h"
|
|
30
35
|
#include "src/core/util/grpc_check.h"
|
|
31
36
|
#include "src/core/util/match.h"
|
|
32
37
|
#include "src/core/util/time.h"
|
|
38
|
+
#include "absl/functional/any_invocable.h"
|
|
39
|
+
#include "absl/status/status.h"
|
|
40
|
+
#include "absl/types/span.h"
|
|
33
41
|
|
|
34
42
|
namespace grpc_core {
|
|
35
43
|
namespace http2 {
|
|
36
44
|
using Callback = absl::AnyInvocable<void()>;
|
|
37
45
|
using grpc_event_engine::experimental::EventEngine;
|
|
38
46
|
|
|
39
|
-
#define GRPC_HTTP2_PING_LOG \
|
|
40
|
-
LOG_IF(INFO, (GRPC_TRACE_FLAG_ENABLED(http) || \
|
|
41
|
-
GRPC_TRACE_FLAG_ENABLED(bdp_estimator) || \
|
|
42
|
-
GRPC_TRACE_FLAG_ENABLED(http_keepalive) || \
|
|
43
|
-
GRPC_TRACE_FLAG_ENABLED(http2_ping)))
|
|
44
|
-
|
|
45
47
|
Promise<absl::Status> PingManager::PingPromiseCallbacks::RequestPing(
|
|
46
48
|
Callback on_initiate, bool important) {
|
|
47
49
|
important_ping_requested_ = (important_ping_requested_ || important);
|
|
@@ -68,28 +70,10 @@ PingManager::PingManager(const ChannelArgs& channel_args, Duration ping_timeout,
|
|
|
68
70
|
ping_interface_(std::move(ping_interface)),
|
|
69
71
|
ping_timeout_(ping_timeout) {}
|
|
70
72
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (delayed_ping_spawned_) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
delayed_ping_spawned_ = true;
|
|
77
|
-
GetContext<Party>()->Spawn(
|
|
78
|
-
"DelayedPing",
|
|
79
|
-
// TODO(akshitpatel) : [PH2][P2] : Verify if we need a RefCountedPtr for
|
|
80
|
-
// ping_manager.
|
|
81
|
-
[this, wait]() mutable {
|
|
82
|
-
GRPC_HTTP2_PING_LOG << "Scheduling delayed ping after wait=" << wait;
|
|
83
|
-
return AssertResultType<absl::Status>(TrySeq(
|
|
84
|
-
Sleep(wait),
|
|
85
|
-
[this]() mutable { return ping_interface_->TriggerWrite(); }));
|
|
86
|
-
},
|
|
87
|
-
[this](auto) { delayed_ping_spawned_ = false; });
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
bool PingManager::NeedToPing(const Duration next_allowed_ping_interval) {
|
|
73
|
+
PingManager::TriggerPingArgs PingManager::NeedToPing(
|
|
74
|
+
const Duration next_allowed_ping_interval) {
|
|
91
75
|
if (!ping_callbacks_.PingRequested()) {
|
|
92
|
-
return false;
|
|
76
|
+
return TriggerPingArgs(std::nullopt, /*need_to_ping=*/false);
|
|
93
77
|
}
|
|
94
78
|
|
|
95
79
|
return Match(
|
|
@@ -100,13 +84,13 @@ bool PingManager::NeedToPing(const Duration next_allowed_ping_interval) {
|
|
|
100
84
|
GRPC_HTTP2_PING_LOG << "CLIENT" << "[" << "PH2"
|
|
101
85
|
<< "]: Ping sent"
|
|
102
86
|
<< ping_rate_policy_.GetDebugString();
|
|
103
|
-
return true;
|
|
87
|
+
return TriggerPingArgs(std::nullopt, /*need_to_ping=*/true);
|
|
104
88
|
},
|
|
105
89
|
[this](Chttp2PingRatePolicy::TooManyRecentPings) {
|
|
106
90
|
GRPC_HTTP2_PING_LOG << "CLIENT" << "[" << "PH2"
|
|
107
91
|
<< "]: Ping delayed too many recent pings: "
|
|
108
92
|
<< ping_rate_policy_.GetDebugString();
|
|
109
|
-
return false;
|
|
93
|
+
return TriggerPingArgs(std::nullopt, /*need_to_ping=*/false);
|
|
110
94
|
},
|
|
111
95
|
[this](Chttp2PingRatePolicy::TooSoon too_soon) mutable {
|
|
112
96
|
GRPC_HTTP2_PING_LOG
|
|
@@ -115,73 +99,49 @@ bool PingManager::NeedToPing(const Duration next_allowed_ping_interval) {
|
|
|
115
99
|
<< too_soon.last_ping
|
|
116
100
|
<< ", minimum wait:" << too_soon.next_allowed_ping_interval
|
|
117
101
|
<< ", need to wait:" << too_soon.wait;
|
|
118
|
-
|
|
119
|
-
|
|
102
|
+
std::optional<Duration> delayed_ping_wait;
|
|
103
|
+
if (!std::exchange(delayed_ping_spawned_, true)) {
|
|
104
|
+
delayed_ping_wait = too_soon.wait;
|
|
105
|
+
}
|
|
106
|
+
return TriggerPingArgs(delayed_ping_wait, /*need_to_ping=*/false);
|
|
120
107
|
});
|
|
121
108
|
}
|
|
122
109
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
GetContext<Party>()->Spawn(
|
|
126
|
-
"PingTimeout",
|
|
127
|
-
// TODO(akshitpatel) : [PH2][P2] : Verify if we need a RefCountedPtr for
|
|
128
|
-
// ping_manager.
|
|
129
|
-
[this, ping_timeout, opaque_data]() {
|
|
130
|
-
return AssertResultType<absl::Status>(Race(
|
|
131
|
-
TrySeq(ping_callbacks_.PingTimeout(ping_timeout),
|
|
132
|
-
[this, opaque_data](bool trigger_ping_timeout) mutable {
|
|
133
|
-
return If(
|
|
134
|
-
trigger_ping_timeout,
|
|
135
|
-
[this, opaque_data]() {
|
|
136
|
-
GRPC_HTTP2_PING_LOG
|
|
137
|
-
<< " Ping ack not received for id="
|
|
138
|
-
<< opaque_data << ". Ping timeout triggered.";
|
|
139
|
-
return ping_interface_->PingTimeout();
|
|
140
|
-
},
|
|
141
|
-
[]() { return absl::OkStatus(); });
|
|
142
|
-
}),
|
|
143
|
-
ping_callbacks_.WaitForPingAck()));
|
|
144
|
-
},
|
|
145
|
-
[](auto) {});
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
void PingManager::MaybeGetSerializedPingFrames(
|
|
149
|
-
SliceBuffer& output_buffer, const Duration next_allowed_ping_interval) {
|
|
110
|
+
std::optional<Duration> PingManager::MaybeGetSerializedPingFrames(
|
|
111
|
+
FrameSender& frame_sender, Duration next_allowed_ping_interval) {
|
|
150
112
|
GRPC_HTTP2_PING_LOG << "PingManager MaybeGetSerializedPingFrames "
|
|
151
113
|
"pending_ping_acks_ size: "
|
|
152
114
|
<< pending_ping_acks_.size()
|
|
153
115
|
<< " next_allowed_ping_interval: "
|
|
154
116
|
<< next_allowed_ping_interval;
|
|
155
117
|
GRPC_DCHECK(!opaque_data_.has_value());
|
|
156
|
-
|
|
157
|
-
frames.reserve(pending_ping_acks_.size() + 1); // +1 for the ping frame.
|
|
118
|
+
frame_sender.ReserveRegularFrames(pending_ping_acks_.size() + 1);
|
|
158
119
|
|
|
159
120
|
// Get the serialized ping acks if needed.
|
|
160
121
|
for (uint64_t opaque_data : pending_ping_acks_) {
|
|
161
|
-
|
|
122
|
+
frame_sender.AddRegularFrame(GetHttp2PingFrame(/*ack=*/true, opaque_data));
|
|
162
123
|
}
|
|
163
124
|
pending_ping_acks_.clear();
|
|
164
125
|
|
|
165
126
|
// Get the serialized ping frame if needed.
|
|
166
|
-
|
|
127
|
+
TriggerPingArgs trigger_ping_args = NeedToPing(next_allowed_ping_interval);
|
|
128
|
+
if (trigger_ping_args.need_to_ping) {
|
|
167
129
|
const uint64_t opaque_data = ping_callbacks_.StartPing();
|
|
168
|
-
|
|
130
|
+
frame_sender.AddRegularFrame(GetHttp2PingFrame(/*ack=*/false, opaque_data));
|
|
169
131
|
opaque_data_ = opaque_data;
|
|
170
132
|
GRPC_HTTP2_PING_LOG << "Created ping frame for id= " << opaque_data;
|
|
171
133
|
}
|
|
172
134
|
|
|
173
|
-
|
|
174
|
-
if (!frames.empty()) {
|
|
175
|
-
Serialize(absl::Span<Http2Frame>(frames), output_buffer);
|
|
176
|
-
}
|
|
135
|
+
return trigger_ping_args.delayed_ping_wait;
|
|
177
136
|
}
|
|
178
137
|
|
|
179
|
-
|
|
138
|
+
std::optional<uint64_t> PingManager::NotifyPingSent() {
|
|
180
139
|
if (opaque_data_.has_value()) {
|
|
181
|
-
SpawnTimeout(ping_timeout_, opaque_data_.value());
|
|
182
140
|
SentPing();
|
|
183
|
-
opaque_data_
|
|
141
|
+
return std::exchange(opaque_data_, std::nullopt);
|
|
184
142
|
}
|
|
143
|
+
|
|
144
|
+
return std::nullopt;
|
|
185
145
|
}
|
|
186
146
|
|
|
187
147
|
void PingManager::AddPendingPingAck(const uint64_t opaque_data) {
|
|
@@ -18,24 +18,44 @@
|
|
|
18
18
|
#ifndef GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_PING_PROMISE_H
|
|
19
19
|
#define GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_PING_PROMISE_H
|
|
20
20
|
|
|
21
|
+
#include <cstddef>
|
|
22
|
+
#include <cstdint>
|
|
21
23
|
#include <memory>
|
|
24
|
+
#include <optional>
|
|
25
|
+
#include <utility>
|
|
26
|
+
#include <vector>
|
|
22
27
|
|
|
23
28
|
#include "src/core/ext/transport/chttp2/transport/frame.h"
|
|
24
29
|
#include "src/core/ext/transport/chttp2/transport/ping_abuse_policy.h"
|
|
25
30
|
#include "src/core/ext/transport/chttp2/transport/ping_callbacks.h"
|
|
26
31
|
#include "src/core/ext/transport/chttp2/transport/ping_rate_policy.h"
|
|
32
|
+
#include "src/core/ext/transport/chttp2/transport/write_cycle.h"
|
|
33
|
+
#include "src/core/lib/channel/channel_args.h"
|
|
27
34
|
#include "src/core/lib/promise/if.h"
|
|
28
35
|
#include "src/core/lib/promise/inter_activity_latch.h"
|
|
29
36
|
#include "src/core/lib/promise/map.h"
|
|
37
|
+
#include "src/core/lib/promise/poll.h"
|
|
30
38
|
#include "src/core/lib/promise/promise.h"
|
|
39
|
+
#include "src/core/lib/promise/race.h"
|
|
40
|
+
#include "src/core/lib/promise/sleep.h"
|
|
41
|
+
#include "src/core/lib/promise/try_seq.h"
|
|
31
42
|
#include "src/core/lib/slice/slice_buffer.h"
|
|
32
43
|
#include "src/core/util/grpc_check.h"
|
|
33
44
|
#include "src/core/util/shared_bit_gen.h"
|
|
34
45
|
#include "src/core/util/time.h"
|
|
46
|
+
#include "absl/functional/any_invocable.h"
|
|
47
|
+
#include "absl/log/log.h"
|
|
48
|
+
#include "absl/status/status.h"
|
|
35
49
|
|
|
36
50
|
namespace grpc_core {
|
|
37
51
|
namespace http2 {
|
|
38
52
|
|
|
53
|
+
#define GRPC_HTTP2_PING_LOG \
|
|
54
|
+
LOG_IF(INFO, (GRPC_TRACE_FLAG_ENABLED(http) || \
|
|
55
|
+
GRPC_TRACE_FLAG_ENABLED(bdp_estimator) || \
|
|
56
|
+
GRPC_TRACE_FLAG_ENABLED(http_keepalive) || \
|
|
57
|
+
GRPC_TRACE_FLAG_ENABLED(http2_ping)))
|
|
58
|
+
|
|
39
59
|
// Ping Promise Spawns Overview
|
|
40
60
|
|
|
41
61
|
// | Promise Spawn | Max Duration | Promise | Max Spawns |
|
|
@@ -60,7 +80,7 @@ namespace http2 {
|
|
|
60
80
|
class PingInterface {
|
|
61
81
|
public:
|
|
62
82
|
// Returns a promise that triggers a write cycle on the transport.
|
|
63
|
-
virtual
|
|
83
|
+
virtual absl::Status TriggerWrite() = 0;
|
|
64
84
|
|
|
65
85
|
// Returns a promise that handles the ping timeout.
|
|
66
86
|
virtual Promise<absl::Status> PingTimeout() = 0;
|
|
@@ -71,83 +91,17 @@ class PingInterface {
|
|
|
71
91
|
// single thread. This guarantee is achieved by spawning all the promises
|
|
72
92
|
// returned by this class on the same transport party.
|
|
73
93
|
class PingManager {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
// If there are any pending ping requests or ping acks, populates the output
|
|
81
|
-
// buffer with the serialized ping frames.
|
|
82
|
-
void MaybeGetSerializedPingFrames(SliceBuffer& output_buf,
|
|
83
|
-
Duration next_allowed_ping_interval);
|
|
84
|
-
|
|
85
|
-
// Notify the ping system that a ping has been sent. This will spawn a ping
|
|
86
|
-
// timeout promise.
|
|
87
|
-
void NotifyPingSent();
|
|
88
|
-
|
|
89
|
-
// Ping Rate policy wrapper
|
|
90
|
-
void ReceivedDataFrame() { ping_rate_policy_.ReceivedDataFrame(); }
|
|
91
|
-
|
|
92
|
-
// Ping abuse policy wrapper
|
|
93
|
-
bool NotifyPingAbusePolicy(const bool transport_idle) {
|
|
94
|
-
return ping_abuse_policy_.ReceivedOnePing(transport_idle);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
void ResetPingClock(bool is_client) {
|
|
98
|
-
if (!is_client) {
|
|
99
|
-
ping_abuse_policy_.ResetPingStrikes();
|
|
100
|
-
}
|
|
101
|
-
ping_rate_policy_.ResetPingsBeforeDataRequired();
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Ping callbacks wrapper
|
|
105
|
-
|
|
106
|
-
// Returns a promise that resolves once a new ping is initiated and ack is
|
|
107
|
-
// received for the same. The on_initiate callback is executed when the
|
|
108
|
-
// ping is initiated.
|
|
109
|
-
auto RequestPing(absl::AnyInvocable<void()> on_initiate, bool important) {
|
|
110
|
-
return ping_callbacks_.RequestPing(std::move(on_initiate), important);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// Returns a promise that resolves once the next valid ping ack is received.
|
|
114
|
-
auto WaitForPingAck() { return ping_callbacks_.WaitForPingAck(); }
|
|
115
|
-
|
|
116
|
-
// Cancels all the callbacks for the inflight pings. This function does not
|
|
117
|
-
// cancel the promises that are waiting on the ping ack.
|
|
118
|
-
// This should be called as part of closing the transport to free up any
|
|
119
|
-
// memory in use by the ping callbacks.
|
|
120
|
-
void CancelCallbacks() { ping_callbacks_.CancelCallbacks(); }
|
|
121
|
-
|
|
122
|
-
uint64_t StartPing() { return ping_callbacks_.StartPing(); }
|
|
123
|
-
bool PingRequested() { return ping_callbacks_.PingRequested(); }
|
|
124
|
-
bool ImportantPingRequested() const {
|
|
125
|
-
return ping_callbacks_.ImportantPingRequested();
|
|
126
|
-
}
|
|
127
|
-
bool AckPing(uint64_t id) { return ping_callbacks_.AckPing(id); }
|
|
128
|
-
size_t CountPingInflight() { return ping_callbacks_.CountPingInflight(); }
|
|
129
|
-
|
|
130
|
-
Http2Frame GetHttp2PingFrame(uint64_t opaque_data) {
|
|
131
|
-
return Http2PingFrame{/*ack=*/false, opaque_data};
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
std::optional<uint64_t> TestOnlyMaybeGetSerializedPingFrames(
|
|
135
|
-
SliceBuffer& output_buffer, Duration next_allowed_ping_interval) {
|
|
136
|
-
GRPC_DCHECK(!opaque_data_.has_value());
|
|
137
|
-
if (NeedToPing(next_allowed_ping_interval)) {
|
|
138
|
-
uint64_t opaque_data = ping_callbacks_.StartPing();
|
|
139
|
-
Http2Frame frame = GetHttp2PingFrame(/*ack*/ false, opaque_data);
|
|
140
|
-
Serialize(absl::Span<Http2Frame>(&frame, 1), output_buffer);
|
|
141
|
-
opaque_data_ = opaque_data;
|
|
142
|
-
return opaque_data;
|
|
94
|
+
private:
|
|
95
|
+
struct TriggerPingArgs {
|
|
96
|
+
TriggerPingArgs(std::optional<Duration> delayed_ping_wait,
|
|
97
|
+
bool need_to_ping)
|
|
98
|
+
: delayed_ping_wait(delayed_ping_wait), need_to_ping(need_to_ping) {
|
|
99
|
+
GRPC_DCHECK(!(delayed_ping_wait.has_value() && need_to_ping));
|
|
143
100
|
}
|
|
144
101
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
void AddPendingPingAck(uint64_t opaque_data);
|
|
149
|
-
|
|
150
|
-
private:
|
|
102
|
+
std::optional<Duration> delayed_ping_wait;
|
|
103
|
+
bool need_to_ping;
|
|
104
|
+
};
|
|
151
105
|
class PingPromiseCallbacks {
|
|
152
106
|
public:
|
|
153
107
|
explicit PingPromiseCallbacks(
|
|
@@ -225,11 +179,101 @@ class PingManager {
|
|
|
225
179
|
// Duration to wait before triggering a ping timeout.
|
|
226
180
|
Duration ping_timeout_;
|
|
227
181
|
|
|
228
|
-
|
|
229
|
-
bool NeedToPing(Duration next_allowed_ping_interval);
|
|
230
|
-
void SpawnTimeout(Duration ping_timeout, uint64_t opaque_data);
|
|
182
|
+
TriggerPingArgs NeedToPing(Duration next_allowed_ping_interval);
|
|
231
183
|
|
|
232
184
|
void SentPing() { ping_rate_policy_.SentPing(); }
|
|
185
|
+
|
|
186
|
+
public:
|
|
187
|
+
PingManager(const ChannelArgs& channel_args, Duration ping_timeout,
|
|
188
|
+
std::unique_ptr<PingInterface> ping_interface,
|
|
189
|
+
std::shared_ptr<grpc_event_engine::experimental::EventEngine>
|
|
190
|
+
event_engine);
|
|
191
|
+
|
|
192
|
+
// If there are any pending ping requests or ping acks, populates the output
|
|
193
|
+
// buffer with the serialized ping frames. Returns the arguments for
|
|
194
|
+
// scheduling the delayed ping.
|
|
195
|
+
std::optional<Duration> MaybeGetSerializedPingFrames(
|
|
196
|
+
FrameSender& frame_sender, Duration next_allowed_ping_interval);
|
|
197
|
+
|
|
198
|
+
// Notify the ping system that a ping has been sent. Returns the opaque data
|
|
199
|
+
// of the ping frame if a new ping was sent. The caller is expected to
|
|
200
|
+
// spawn a ping timeout promise using TimeoutPromise() for this returned
|
|
201
|
+
// value.
|
|
202
|
+
std::optional<uint64_t> NotifyPingSent();
|
|
203
|
+
|
|
204
|
+
// Ping Rate policy wrapper
|
|
205
|
+
void ReceivedDataFrame() { ping_rate_policy_.ReceivedDataFrame(); }
|
|
206
|
+
|
|
207
|
+
// Ping abuse policy wrapper
|
|
208
|
+
bool NotifyPingAbusePolicy(const bool transport_idle) {
|
|
209
|
+
return ping_abuse_policy_.ReceivedOnePing(transport_idle);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
void ResetPingClock(bool is_client) {
|
|
213
|
+
if (!is_client) {
|
|
214
|
+
ping_abuse_policy_.ResetPingStrikes();
|
|
215
|
+
}
|
|
216
|
+
ping_rate_policy_.ResetPingsBeforeDataRequired();
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// Ping callbacks wrapper
|
|
220
|
+
|
|
221
|
+
// Returns a promise that resolves once a new ping is initiated and ack is
|
|
222
|
+
// received for the same. The on_initiate callback is executed when the
|
|
223
|
+
// ping is initiated.
|
|
224
|
+
auto RequestPing(absl::AnyInvocable<void()> on_initiate, bool important) {
|
|
225
|
+
return ping_callbacks_.RequestPing(std::move(on_initiate), important);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Returns a promise that resolves once the next valid ping ack is received.
|
|
229
|
+
auto WaitForPingAck() { return ping_callbacks_.WaitForPingAck(); }
|
|
230
|
+
|
|
231
|
+
// Cancels all the callbacks for the inflight pings. This function does not
|
|
232
|
+
// cancel the promises that are waiting on the ping ack.
|
|
233
|
+
// This should be called as part of closing the transport to free up any
|
|
234
|
+
// memory in use by the ping callbacks.
|
|
235
|
+
void CancelCallbacks() { ping_callbacks_.CancelCallbacks(); }
|
|
236
|
+
|
|
237
|
+
uint64_t StartPing() { return ping_callbacks_.StartPing(); }
|
|
238
|
+
bool PingRequested() { return ping_callbacks_.PingRequested(); }
|
|
239
|
+
bool ImportantPingRequested() const {
|
|
240
|
+
return ping_callbacks_.ImportantPingRequested();
|
|
241
|
+
}
|
|
242
|
+
bool AckPing(uint64_t id) { return ping_callbacks_.AckPing(id); }
|
|
243
|
+
size_t CountPingInflight() { return ping_callbacks_.CountPingInflight(); }
|
|
244
|
+
|
|
245
|
+
Http2Frame GetHttp2PingFrame(uint64_t opaque_data) {
|
|
246
|
+
return Http2PingFrame{/*ack=*/false, opaque_data};
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
void AddPendingPingAck(uint64_t opaque_data);
|
|
250
|
+
|
|
251
|
+
auto TimeoutPromise(const uint64_t opaque_data) {
|
|
252
|
+
return AssertResultType<absl::Status>(Race(
|
|
253
|
+
TrySeq(ping_callbacks_.PingTimeout(ping_timeout_),
|
|
254
|
+
[this, opaque_data](bool trigger_ping_timeout) mutable {
|
|
255
|
+
return If(
|
|
256
|
+
trigger_ping_timeout,
|
|
257
|
+
[this, opaque_data]() {
|
|
258
|
+
GRPC_HTTP2_PING_LOG
|
|
259
|
+
<< " Ping ack not received for id=" << opaque_data
|
|
260
|
+
<< ". Ping timeout triggered.";
|
|
261
|
+
return ping_interface_->PingTimeout();
|
|
262
|
+
},
|
|
263
|
+
[]() { return absl::OkStatus(); });
|
|
264
|
+
}),
|
|
265
|
+
ping_callbacks_.WaitForPingAck()));
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
auto DelayedPingPromise(const Duration wait) {
|
|
269
|
+
return TrySeq(
|
|
270
|
+
Sleep(wait),
|
|
271
|
+
[this]() mutable { return ping_interface_->TriggerWrite(); },
|
|
272
|
+
[this]() {
|
|
273
|
+
delayed_ping_spawned_ = false;
|
|
274
|
+
return absl::OkStatus();
|
|
275
|
+
});
|
|
276
|
+
}
|
|
233
277
|
};
|
|
234
278
|
} // namespace http2
|
|
235
279
|
} // namespace grpc_core
|