grpc 1.78.1 → 1.80.0
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/version.rb +1 -1
- data/src/ruby/pb/generate_proto_ruby.sh +1 -1
- metadata +42 -6
- data/src/core/ext/transport/chttp2/transport/security_frame.cc +0 -31
- data/src/core/handshaker/security/legacy_secure_endpoint.cc +0 -597
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
//
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2026 gRPC authors.
|
|
4
|
+
//
|
|
5
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
// you may not use this file except in compliance with the License.
|
|
7
|
+
// You may obtain a copy of the License at
|
|
8
|
+
//
|
|
9
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
//
|
|
11
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
// See the License for the specific language governing permissions and
|
|
15
|
+
// limitations under the License.
|
|
16
|
+
//
|
|
17
|
+
//
|
|
18
|
+
|
|
19
|
+
#ifndef GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_WRITE_CYCLE_H
|
|
20
|
+
#define GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_WRITE_CYCLE_H
|
|
21
|
+
|
|
22
|
+
#include <grpc/support/port_platform.h>
|
|
23
|
+
|
|
24
|
+
#include <cstddef>
|
|
25
|
+
#include <string>
|
|
26
|
+
#include <utility>
|
|
27
|
+
|
|
28
|
+
#include "src/core/ext/transport/chttp2/transport/frame.h"
|
|
29
|
+
#include "src/core/ext/transport/chttp2/transport/transport_common.h"
|
|
30
|
+
#include "src/core/ext/transport/chttp2/transport/write_size_policy.h"
|
|
31
|
+
#include "src/core/lib/slice/slice_buffer.h"
|
|
32
|
+
#include "src/core/lib/transport/promise_endpoint.h"
|
|
33
|
+
#include "absl/container/inlined_vector.h"
|
|
34
|
+
|
|
35
|
+
namespace grpc_core {
|
|
36
|
+
namespace http2 {
|
|
37
|
+
|
|
38
|
+
// Tracks the number of bytes that can be written in the current write
|
|
39
|
+
// attempt.
|
|
40
|
+
class WriteQuota {
|
|
41
|
+
public:
|
|
42
|
+
explicit WriteQuota(size_t target_write_size)
|
|
43
|
+
: target_write_size_(target_write_size) {}
|
|
44
|
+
|
|
45
|
+
// WriteQuota is move-constructible but not copyable or assignable.
|
|
46
|
+
WriteQuota(const WriteQuota&) = delete;
|
|
47
|
+
WriteQuota& operator=(const WriteQuota&) = delete;
|
|
48
|
+
WriteQuota(WriteQuota&&) = default;
|
|
49
|
+
WriteQuota& operator=(WriteQuota&&) = delete;
|
|
50
|
+
|
|
51
|
+
// Increments the bytes consumed for the current write attempt.
|
|
52
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION void IncrementBytesConsumed(
|
|
53
|
+
size_t bytes_consumed) {
|
|
54
|
+
bytes_consumed_ += bytes_consumed;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Returns the number of bytes remaining that can be written in the current
|
|
58
|
+
// write attempt.
|
|
59
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION size_t GetWriteBytesRemaining() const {
|
|
60
|
+
return (target_write_size_ > bytes_consumed_)
|
|
61
|
+
? target_write_size_ - bytes_consumed_
|
|
62
|
+
: 0u;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Returns the target write size for the current write attempt.
|
|
66
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION size_t GetTargetWriteSize() const {
|
|
67
|
+
return target_write_size_;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
std::string DebugString() const;
|
|
71
|
+
|
|
72
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION size_t TestOnlyBytesConsumed() const {
|
|
73
|
+
return bytes_consumed_;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
private:
|
|
77
|
+
const size_t target_write_size_;
|
|
78
|
+
size_t bytes_consumed_ = 0;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// Tracks frames that need to be serialized for the current write attempt.
|
|
82
|
+
class WriteBufferTracker {
|
|
83
|
+
public:
|
|
84
|
+
static constexpr size_t kInlinedRegularFramesSize = 8;
|
|
85
|
+
static constexpr size_t kInlinedUrgentFramesSize = 2;
|
|
86
|
+
|
|
87
|
+
explicit WriteBufferTracker(bool& is_first_write, const bool is_client)
|
|
88
|
+
: is_first_write_(is_first_write), is_client_(is_client) {}
|
|
89
|
+
|
|
90
|
+
// WriteBufferTracker is move-constructible but not copyable or assignable.
|
|
91
|
+
WriteBufferTracker(const WriteBufferTracker&) = delete;
|
|
92
|
+
WriteBufferTracker& operator=(const WriteBufferTracker&) = delete;
|
|
93
|
+
WriteBufferTracker(WriteBufferTracker&&) = default;
|
|
94
|
+
WriteBufferTracker& operator=(WriteBufferTracker&&) = delete;
|
|
95
|
+
|
|
96
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION void AddRegularFrame(
|
|
97
|
+
Http2Frame&& frame) {
|
|
98
|
+
regular_frames_.emplace_back(std::forward<Http2Frame>(frame));
|
|
99
|
+
}
|
|
100
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION void AddUrgentFrame(Http2Frame&& frame) {
|
|
101
|
+
urgent_frames_.emplace_back(std::forward<Http2Frame>(frame));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION void ReserveRegularFrames(
|
|
105
|
+
const size_t size) {
|
|
106
|
+
regular_frames_.reserve(regular_frames_.size() + size);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION bool CanSerializeUrgentFrames() const {
|
|
110
|
+
return !urgent_frames_.empty();
|
|
111
|
+
}
|
|
112
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION bool CanSerializeRegularFrames() const {
|
|
113
|
+
return (!regular_frames_.empty() || is_first_write_);
|
|
114
|
+
}
|
|
115
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION bool HasFirstWriteHappened() const {
|
|
116
|
+
return !is_first_write_;
|
|
117
|
+
}
|
|
118
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION size_t GetUrgentFrameCount() const {
|
|
119
|
+
return urgent_frames_.size();
|
|
120
|
+
}
|
|
121
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION size_t GetRegularFrameCount() const {
|
|
122
|
+
return regular_frames_.size();
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION
|
|
126
|
+
absl::InlinedVector<Http2Frame, kInlinedRegularFramesSize>&
|
|
127
|
+
TestOnlyRegularFrames() {
|
|
128
|
+
return regular_frames_;
|
|
129
|
+
}
|
|
130
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION
|
|
131
|
+
absl::InlinedVector<Http2Frame, kInlinedUrgentFramesSize>&
|
|
132
|
+
TestOnlyUrgentFrames() {
|
|
133
|
+
return urgent_frames_;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
std::string DebugString() const;
|
|
137
|
+
|
|
138
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION Http2Frame* MutableLastRegularFrame() {
|
|
139
|
+
return regular_frames_.empty() ? nullptr : ®ular_frames_.back();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
struct SerializeStats {
|
|
143
|
+
bool& should_reset_ping_clock;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
SliceBuffer SerializeRegularFrames(SerializeStats stats) {
|
|
147
|
+
GRPC_DCHECK(CanSerializeRegularFrames());
|
|
148
|
+
return SerializeFrames(regular_frames_, stats);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
SliceBuffer SerializeUrgentFrames(SerializeStats stats) {
|
|
152
|
+
GRPC_DCHECK(CanSerializeUrgentFrames());
|
|
153
|
+
return SerializeFrames(urgent_frames_, stats);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
private:
|
|
157
|
+
template <typename FrameContainer>
|
|
158
|
+
SliceBuffer SerializeFrames(FrameContainer& frames, SerializeStats stats) {
|
|
159
|
+
SliceBuffer output_buf;
|
|
160
|
+
if (GPR_UNLIKELY(is_first_write_)) {
|
|
161
|
+
// https://www.rfc-editor.org/rfc/rfc9113.html#name-http-2-connection-preface
|
|
162
|
+
// RFC9113:
|
|
163
|
+
// The client and server each send a different connection preface.
|
|
164
|
+
// Client: The connection preface starts with the string "PRI *
|
|
165
|
+
// HTTP/2.0\r\n\r\nSM\r\n\r\n". This sequence MUST be followed by a
|
|
166
|
+
// SETTINGS frame, which MAY be empty.
|
|
167
|
+
// Server: The server connection preface consists of a potentially empty
|
|
168
|
+
// SETTINGS frame that MUST be the first frame the server sends in the
|
|
169
|
+
// HTTP/2 connection.
|
|
170
|
+
if (is_client_) {
|
|
171
|
+
output_buf.Append(
|
|
172
|
+
Slice::FromCopiedString(GRPC_CHTTP2_CLIENT_CONNECT_STRING));
|
|
173
|
+
}
|
|
174
|
+
is_first_write_ = false;
|
|
175
|
+
}
|
|
176
|
+
SerializeReturn result =
|
|
177
|
+
Serialize(absl::Span<Http2Frame>(frames), output_buf);
|
|
178
|
+
frames.clear();
|
|
179
|
+
stats.should_reset_ping_clock = result.should_reset_ping_clock;
|
|
180
|
+
return output_buf;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// These frames are serialized and written to the endpoint in a single
|
|
184
|
+
// endpoint write.
|
|
185
|
+
absl::InlinedVector<Http2Frame, kInlinedRegularFramesSize> regular_frames_;
|
|
186
|
+
// If there are urgent frames to be written, these frames are serialized
|
|
187
|
+
// and written to the endpoint separately before the default frames are
|
|
188
|
+
// written.
|
|
189
|
+
absl::InlinedVector<Http2Frame, kInlinedUrgentFramesSize> urgent_frames_;
|
|
190
|
+
bool& is_first_write_;
|
|
191
|
+
const bool is_client_;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
// Wrapper for WriteBufferTracker and WriteQuota to be used by the callers
|
|
195
|
+
// that only need to add frames to the write buffer.
|
|
196
|
+
class FrameSender {
|
|
197
|
+
public:
|
|
198
|
+
FrameSender(WriteBufferTracker& tracker, WriteQuota& quota)
|
|
199
|
+
: tracker_(tracker), quota_(quota) {}
|
|
200
|
+
|
|
201
|
+
// FrameSender is not copyable or assignable.
|
|
202
|
+
FrameSender(FrameSender&&) = delete;
|
|
203
|
+
FrameSender& operator=(FrameSender&&) = delete;
|
|
204
|
+
FrameSender(const FrameSender&) = delete;
|
|
205
|
+
FrameSender& operator=(const FrameSender&) = delete;
|
|
206
|
+
|
|
207
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION void AddRegularFrame(
|
|
208
|
+
Http2Frame&& frame) {
|
|
209
|
+
quota_.IncrementBytesConsumed(GetFrameMemoryUsage(frame));
|
|
210
|
+
tracker_.AddRegularFrame(std::forward<Http2Frame>(frame));
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION void AddUrgentFrame(Http2Frame&& frame) {
|
|
214
|
+
// TODO(akshitpatel) [PH2][P5]: Maybe urgent frames should consume quota
|
|
215
|
+
// too?
|
|
216
|
+
tracker_.AddUrgentFrame(std::forward<Http2Frame>(frame));
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION void ReserveRegularFrames(size_t size) {
|
|
220
|
+
tracker_.ReserveRegularFrames(size);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION Http2Frame* MutableLastRegularFrame() {
|
|
224
|
+
return tracker_.MutableLastRegularFrame();
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
private:
|
|
228
|
+
WriteBufferTracker& tracker_;
|
|
229
|
+
WriteQuota& quota_;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
// Per write cycle state.
|
|
233
|
+
class WriteCycle {
|
|
234
|
+
public:
|
|
235
|
+
WriteCycle(Chttp2WriteSizePolicy* write_size_policy, bool& is_first_write,
|
|
236
|
+
const bool& is_client)
|
|
237
|
+
: write_buffer_tracker_(is_first_write, is_client),
|
|
238
|
+
write_quota_(write_size_policy->WriteTargetSize()),
|
|
239
|
+
write_size_policy_(write_size_policy) {}
|
|
240
|
+
|
|
241
|
+
// WriteCycle is move-constructible but not copyable or assignable.
|
|
242
|
+
WriteCycle(const WriteCycle&) = delete;
|
|
243
|
+
WriteCycle& operator=(const WriteCycle&) = delete;
|
|
244
|
+
WriteCycle(WriteCycle&&) = default;
|
|
245
|
+
WriteCycle& operator=(WriteCycle&&) = delete;
|
|
246
|
+
|
|
247
|
+
using SerializeStats = WriteBufferTracker::SerializeStats;
|
|
248
|
+
|
|
249
|
+
// Wrappers for Chttp2WriteSizePolicy
|
|
250
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION void BeginWrite(
|
|
251
|
+
const size_t bytes_to_write) {
|
|
252
|
+
write_size_policy_->BeginWrite(bytes_to_write);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION void EndWrite(bool success) {
|
|
256
|
+
write_size_policy_->EndWrite(success);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// Wrappers for WriteQuota
|
|
260
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION size_t GetWriteBytesRemaining() const {
|
|
261
|
+
return write_quota_.GetWriteBytesRemaining();
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SliceBuffer
|
|
265
|
+
SerializeRegularFrames(SerializeStats stats) {
|
|
266
|
+
return write_buffer_tracker_.SerializeRegularFrames(stats);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SliceBuffer
|
|
270
|
+
SerializeUrgentFrames(SerializeStats stats) {
|
|
271
|
+
return write_buffer_tracker_.SerializeUrgentFrames(stats);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION bool CanSerializeUrgentFrames() const {
|
|
275
|
+
return write_buffer_tracker_.CanSerializeUrgentFrames();
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION size_t GetUrgentFrameCount() const {
|
|
279
|
+
return write_buffer_tracker_.GetUrgentFrameCount();
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION size_t GetRegularFrameCount() const {
|
|
283
|
+
return write_buffer_tracker_.GetRegularFrameCount();
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION bool CanSerializeRegularFrames() const {
|
|
287
|
+
return write_buffer_tracker_.CanSerializeRegularFrames();
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
absl::InlinedVector<Http2Frame,
|
|
291
|
+
WriteBufferTracker::kInlinedRegularFramesSize>&
|
|
292
|
+
TestOnlyRegularFrames();
|
|
293
|
+
absl::InlinedVector<Http2Frame, WriteBufferTracker::kInlinedUrgentFramesSize>&
|
|
294
|
+
TestOnlyUrgentFrames();
|
|
295
|
+
|
|
296
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION WriteBufferTracker&
|
|
297
|
+
write_buffer_tracker() {
|
|
298
|
+
return write_buffer_tracker_;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION FrameSender GetFrameSender() {
|
|
302
|
+
return FrameSender(write_buffer_tracker_, write_quota_);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
std::string DebugString() const;
|
|
306
|
+
|
|
307
|
+
private:
|
|
308
|
+
WriteBufferTracker write_buffer_tracker_;
|
|
309
|
+
WriteQuota write_quota_;
|
|
310
|
+
Chttp2WriteSizePolicy* write_size_policy_;
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
class TransportWriteContext {
|
|
314
|
+
public:
|
|
315
|
+
explicit TransportWriteContext(const bool is_client)
|
|
316
|
+
: is_client_(is_client) {}
|
|
317
|
+
|
|
318
|
+
// TransportWriteContext cannot be copied, moved or assigned.
|
|
319
|
+
TransportWriteContext(const TransportWriteContext&) = delete;
|
|
320
|
+
TransportWriteContext& operator=(const TransportWriteContext&) = delete;
|
|
321
|
+
TransportWriteContext(TransportWriteContext&&) = delete;
|
|
322
|
+
TransportWriteContext& operator=(TransportWriteContext&&) = delete;
|
|
323
|
+
|
|
324
|
+
void StartWriteCycle() {
|
|
325
|
+
write_cycle_.emplace(&write_size_policy_, is_first_write_, is_client_);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
void EndWriteCycle() { write_cycle_.reset(); }
|
|
329
|
+
|
|
330
|
+
// Calls to this function MUST only be made between StartWriteCycle and
|
|
331
|
+
// EndWriteCycle.
|
|
332
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION WriteCycle& GetWriteCycle() {
|
|
333
|
+
return *write_cycle_;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION bool IsFirstWrite() const {
|
|
337
|
+
return is_first_write_;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
static PromiseEndpoint::WriteArgs GetWriteArgs(
|
|
341
|
+
const Http2Settings& peer_settings);
|
|
342
|
+
|
|
343
|
+
std::string DebugString() const;
|
|
344
|
+
|
|
345
|
+
private:
|
|
346
|
+
Chttp2WriteSizePolicy write_size_policy_;
|
|
347
|
+
std::optional<WriteCycle> write_cycle_;
|
|
348
|
+
bool is_first_write_ = true;
|
|
349
|
+
const bool is_client_;
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
} // namespace http2
|
|
353
|
+
} // namespace grpc_core
|
|
354
|
+
|
|
355
|
+
#endif // GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_WRITE_CYCLE_H
|
|
@@ -341,19 +341,9 @@ class WriteContext {
|
|
|
341
341
|
}
|
|
342
342
|
|
|
343
343
|
grpc_chttp2_stream* NextStream() {
|
|
344
|
-
if (
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
return nullptr;
|
|
348
|
-
}
|
|
349
|
-
} else {
|
|
350
|
-
// TODO(ctiller): this is likely buggy now, but everything seems to be
|
|
351
|
-
// working, so I'm keeping the above fix just for the experiment until
|
|
352
|
-
// we've had time to soak it fully.
|
|
353
|
-
if (t_->outbuf.c_slice_buffer()->length > target_write_size_) {
|
|
354
|
-
result_.partial = true;
|
|
355
|
-
return nullptr;
|
|
356
|
-
}
|
|
344
|
+
if (t_->outbuf.c_slice_buffer()->length >= target_write_size_) {
|
|
345
|
+
result_.partial = true;
|
|
346
|
+
return nullptr;
|
|
357
347
|
}
|
|
358
348
|
|
|
359
349
|
grpc_chttp2_stream* s;
|
|
@@ -422,9 +412,7 @@ class DataSendContext {
|
|
|
422
412
|
{t_->settings.peer().max_frame_size(), stream_remote_window(),
|
|
423
413
|
t_->flow_control.remote_window(),
|
|
424
414
|
static_cast<int64_t>(write_context_->target_write_size()) -
|
|
425
|
-
(
|
|
426
|
-
? static_cast<int64_t>(t_->outbuf.Length())
|
|
427
|
-
: static_cast<int64_t>(0))}),
|
|
415
|
+
static_cast<int64_t>(t_->outbuf.Length())}),
|
|
428
416
|
0, std::numeric_limits<uint32_t>::max());
|
|
429
417
|
}
|
|
430
418
|
|
|
@@ -564,7 +552,7 @@ class StreamWriteContext {
|
|
|
564
552
|
t_->http2_stats->IncrementHttp2StreamStalls();
|
|
565
553
|
report_stall(t_, s_, "stream");
|
|
566
554
|
grpc_chttp2_list_add_stalled_by_stream(t_, s_);
|
|
567
|
-
} else
|
|
555
|
+
} else {
|
|
568
556
|
GRPC_CHTTP2_STREAM_REF(s_, "chttp2_writing:fork");
|
|
569
557
|
grpc_chttp2_list_add_writable_stream(t_, s_);
|
|
570
558
|
stream_became_writable_ = true;
|
|
@@ -725,24 +713,38 @@ grpc_chttp2_begin_write_result grpc_chttp2_begin_write(
|
|
|
725
713
|
num_stream_bytes = t->outbuf.c_slice_buffer()->length - orig_len;
|
|
726
714
|
s->byte_counter += static_cast<size_t>(num_stream_bytes);
|
|
727
715
|
++s->write_counter;
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
if (
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
t->context_list->emplace_back(
|
|
735
|
-
copy_context_fn(s->arena), outbuf_relative_start_pos,
|
|
736
|
-
num_stream_bytes, s->byte_counter, s->write_counter - 1);
|
|
737
|
-
} else if (s->call_tracer != nullptr &&
|
|
738
|
-
grpc_event_engine::experimental::
|
|
739
|
-
grpc_is_event_engine_endpoint(t->ep.get())) {
|
|
716
|
+
// TODO(ctiller): we're duplicating logic here whilst the experiment is
|
|
717
|
+
// rolling out, in order to make the deletion of the experiment simpler.
|
|
718
|
+
if (grpc_core::IsBufferListDeletionPrepEnabled()) {
|
|
719
|
+
if (s->call_tracer != nullptr &&
|
|
720
|
+
grpc_event_engine::experimental::grpc_is_event_engine_endpoint(
|
|
721
|
+
t->ep.get())) {
|
|
740
722
|
// New way of collecting TCP traces
|
|
741
723
|
auto tcp_call_tracer = s->call_tracer->StartNewTcpTrace();
|
|
742
724
|
if (tcp_call_tracer != nullptr) {
|
|
743
725
|
ctx.AddTcpCallTracer(std::move(tcp_call_tracer), s->byte_counter);
|
|
744
726
|
}
|
|
745
727
|
}
|
|
728
|
+
} else {
|
|
729
|
+
if (s->traced && grpc_endpoint_can_track_err(t->ep.get())) {
|
|
730
|
+
grpc_core::CopyContextFn copy_context_fn =
|
|
731
|
+
grpc_core::GrpcHttp2GetCopyContextFn();
|
|
732
|
+
if (copy_context_fn != nullptr &&
|
|
733
|
+
grpc_core::GrpcHttp2GetWriteTimestampsCallback() != nullptr) {
|
|
734
|
+
// Old way of collecting TCP traces
|
|
735
|
+
t->context_list->emplace_back(
|
|
736
|
+
copy_context_fn(s->arena), outbuf_relative_start_pos,
|
|
737
|
+
num_stream_bytes, s->byte_counter, s->write_counter - 1);
|
|
738
|
+
} else if (s->call_tracer != nullptr &&
|
|
739
|
+
grpc_event_engine::experimental::
|
|
740
|
+
grpc_is_event_engine_endpoint(t->ep.get())) {
|
|
741
|
+
// New way of collecting TCP traces
|
|
742
|
+
auto tcp_call_tracer = s->call_tracer->StartNewTcpTrace();
|
|
743
|
+
if (tcp_call_tracer != nullptr) {
|
|
744
|
+
ctx.AddTcpCallTracer(std::move(tcp_call_tracer), s->byte_counter);
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
}
|
|
746
748
|
}
|
|
747
749
|
outbuf_relative_start_pos += num_stream_bytes;
|
|
748
750
|
}
|