grpc 1.81.1 → 1.83.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 +15 -9
- data/etc/roots.pem +10400 -3855
- data/include/grpc/grpc.h +6 -7
- data/include/grpc/grpc_audit_logging.h +2 -2
- data/include/grpc/grpc_security_constants.h +2 -0
- data/include/grpc/impl/channel_arg_names.h +26 -1
- data/src/core/call/call_filters.h +21 -5
- data/src/core/call/call_spine.h +4 -4
- data/src/core/call/client_call.cc +2 -2
- data/src/core/call/interception_chain.h +6 -9
- data/src/core/call/metadata.cc +7 -2
- data/src/core/call/metadata.h +1 -1
- data/src/core/call/metadata_batch.cc +1 -1
- data/src/core/call/metadata_batch.h +17 -1
- data/src/core/call/parsed_metadata.h +7 -2
- data/src/core/call/server_call.cc +16 -4
- data/src/core/call/server_call.h +14 -5
- data/src/core/call/status_util.cc +0 -4
- data/src/core/call/status_util.h +0 -3
- data/src/core/channelz/channel_trace.cc +3 -1
- data/src/core/client_channel/backup_poller.cc +2 -17
- data/src/core/client_channel/client_channel.cc +23 -28
- data/src/core/client_channel/client_channel.h +5 -3
- data/src/core/client_channel/client_channel_filter.cc +19 -30
- data/src/core/client_channel/client_channel_filter.h +2 -2
- data/src/core/client_channel/client_channel_plugin.cc +1 -1
- data/src/core/client_channel/client_channel_service_config.cc +5 -13
- data/src/core/client_channel/config_selector.h +2 -7
- data/src/core/client_channel/direct_channel.cc +5 -1
- data/src/core/client_channel/direct_channel.h +3 -1
- data/src/core/client_channel/dynamic_filters.cc +4 -7
- data/src/core/client_channel/dynamic_filters.h +1 -3
- data/src/core/client_channel/retry_filter.cc +2 -25
- data/src/core/client_channel/retry_filter.h +3 -7
- data/src/core/client_channel/retry_filter_legacy_call_data.cc +1 -1
- data/src/core/client_channel/retry_filter_legacy_call_data.h +2 -2
- data/src/core/client_channel/retry_interceptor.cc +7 -35
- data/src/core/client_channel/retry_interceptor.h +11 -14
- data/src/core/client_channel/retry_service_config.cc +0 -2
- data/src/core/client_channel/retry_service_config.h +0 -2
- data/src/core/client_channel/retry_throttle.cc +19 -7
- data/src/core/client_channel/retry_throttle.h +24 -7
- data/src/core/client_channel/subchannel.cc +1 -1
- data/src/core/{filter/blackboard.cc → config/experiment_env_var.cc} +11 -14
- data/src/core/config/experiment_env_var.h +26 -0
- data/src/core/credentials/call/external/external_account_credentials.cc +125 -12
- data/src/core/credentials/call/external/external_account_credentials.h +6 -1
- data/src/core/credentials/call/jwt/jwt_credentials.cc +11 -1
- data/src/core/credentials/call/jwt/jwt_credentials.h +3 -0
- data/src/core/credentials/call/oauth2/oauth2_credentials.cc +64 -11
- data/src/core/credentials/call/oauth2/oauth2_credentials.h +0 -1
- data/src/core/credentials/call/regional_access_boundary_fetcher.cc +411 -0
- data/src/core/credentials/call/regional_access_boundary_fetcher.h +158 -0
- data/src/core/credentials/call/token_fetcher/token_fetcher_credentials.cc +1 -1
- data/src/core/credentials/call/token_fetcher/token_fetcher_credentials.h +7 -1
- data/src/core/credentials/transport/insecure/insecure_security_connector.h +1 -1
- data/src/core/credentials/transport/local/local_security_connector.cc +1 -1
- data/src/core/credentials/transport/ssl/ssl_security_connector.cc +14 -2
- data/src/core/credentials/transport/tls/grpc_tls_certificate_selector.cc +172 -0
- data/src/core/credentials/transport/tls/grpc_tls_certificate_selector.h +103 -0
- data/src/core/credentials/transport/tls/load_system_roots_fallback.cc +3 -2
- data/src/core/credentials/transport/tls/load_system_roots_supported.cc +10 -3
- data/src/core/credentials/transport/tls/tls_security_connector.cc +14 -2
- data/src/core/credentials/transport/xds/xds_credentials.cc +4 -12
- data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +6 -0
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +28 -66
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +0 -8
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +24 -58
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.h +24 -19
- data/src/core/ext/filters/message_size/message_size_filter.cc +1 -81
- data/src/core/ext/filters/message_size/message_size_filter.h +1 -50
- data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +2 -1
- data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +13 -56
- data/src/core/ext/filters/stateful_session/stateful_session_filter.h +0 -14
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +1 -1
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +184 -54
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +10 -1
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +84 -15
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +1 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +3 -3
- data/src/core/ext/transport/chttp2/transport/flow_control.h +14 -2
- data/src/core/ext/transport/chttp2/transport/flow_control_manager.h +2 -4
- data/src/core/ext/transport/chttp2/transport/frame.cc +120 -13
- data/src/core/ext/transport/chttp2/transport/frame.h +57 -10
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +4 -1
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +13 -7
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_security.cc +10 -1
- data/src/core/ext/transport/chttp2/transport/frame_security.h +2 -1
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +4 -1
- data/src/core/ext/transport/chttp2/transport/goaway.cc +11 -1
- data/src/core/ext/transport/chttp2/transport/goaway.h +17 -1
- data/src/core/ext/transport/chttp2/transport/header_assembler.h +54 -22
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +53 -5
- data/src/core/ext/transport/chttp2/transport/hpack_parse_result.cc +22 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parse_result.h +20 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +42 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +4 -1
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +219 -417
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +49 -29
- data/src/core/ext/transport/chttp2/transport/http2_server_transport.cc +2073 -0
- data/src/core/ext/transport/chttp2/transport/http2_server_transport.h +746 -0
- data/src/core/ext/transport/chttp2/transport/http2_settings.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +49 -15
- data/src/core/ext/transport/chttp2/transport/http2_settings_manager.h +0 -2
- data/src/core/ext/transport/chttp2/transport/http2_settings_promises.h +74 -26
- data/src/core/ext/transport/chttp2/transport/http2_transport.cc +39 -15
- data/src/core/ext/transport/chttp2/transport/http2_transport.h +18 -48
- data/src/core/ext/transport/chttp2/transport/internal.h +18 -0
- data/src/core/ext/transport/chttp2/transport/message_assembler.h +1 -2
- data/src/core/ext/transport/chttp2/transport/parsing.cc +85 -26
- data/src/core/ext/transport/chttp2/transport/ping_promise.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc +4 -10
- data/src/core/ext/transport/chttp2/transport/read_context.h +494 -0
- data/src/core/ext/transport/chttp2/transport/security_frame.h +13 -3
- data/src/core/ext/transport/chttp2/transport/stream.h +287 -137
- data/src/core/ext/transport/chttp2/transport/stream_data_queue.h +83 -65
- data/src/core/ext/transport/chttp2/transport/write_cycle.h +9 -1
- data/src/core/ext/transport/inproc/legacy_inproc_transport.cc +16 -2
- data/src/core/ext/upb-gen/cel/expr/checked.upb.h +621 -432
- data/src/core/ext/upb-gen/cel/expr/checked.upb_minitable.c +264 -166
- data/src/core/ext/upb-gen/cel/expr/checked.upb_minitable.h +0 -13
- data/src/core/ext/upb-gen/cel/expr/syntax.upb.h +708 -497
- data/src/core/ext/upb-gen/cel/expr/syntax.upb_minitable.c +294 -176
- data/src/core/ext/upb-gen/cel/expr/syntax.upb_minitable.h +0 -15
- data/src/core/ext/upb-gen/envoy/admin/v3/certs.upb.h +262 -181
- data/src/core/ext/upb-gen/envoy/admin/v3/certs.upb_minitable.c +84 -58
- data/src/core/ext/upb-gen/envoy/admin/v3/certs.upb_minitable.h +0 -5
- data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb.h +254 -190
- data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb_minitable.c +107 -53
- data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb_minitable.h +0 -4
- data/src/core/ext/upb-gen/envoy/admin/v3/config_dump.upb.h +271 -190
- data/src/core/ext/upb-gen/envoy/admin/v3/config_dump.upb_minitable.c +88 -64
- data/src/core/ext/upb-gen/envoy/admin/v3/config_dump.upb_minitable.h +0 -5
- data/src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb.h +1035 -730
- data/src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb_minitable.c +384 -260
- data/src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb_minitable.h +0 -19
- data/src/core/ext/upb-gen/envoy/admin/v3/init_dump.upb.h +87 -56
- data/src/core/ext/upb-gen/envoy/admin/v3/init_dump.upb_minitable.c +26 -16
- data/src/core/ext/upb-gen/envoy/admin/v3/init_dump.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/admin/v3/listeners.upb.h +105 -71
- data/src/core/ext/upb-gen/envoy/admin/v3/listeners.upb_minitable.c +30 -22
- data/src/core/ext/upb-gen/envoy/admin/v3/listeners.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/admin/v3/memory.upb.h +31 -29
- data/src/core/ext/upb-gen/envoy/admin/v3/memory.upb_minitable.c +19 -7
- data/src/core/ext/upb-gen/envoy/admin/v3/memory.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/admin/v3/metrics.upb.h +25 -23
- data/src/core/ext/upb-gen/envoy/admin/v3/metrics.upb_minitable.c +15 -7
- data/src/core/ext/upb-gen/envoy/admin/v3/metrics.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/admin/v3/mutex_stats.upb.h +25 -23
- data/src/core/ext/upb-gen/envoy/admin/v3/mutex_stats.upb_minitable.c +15 -7
- data/src/core/ext/upb-gen/envoy/admin/v3/mutex_stats.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb.h +201 -165
- data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb_minitable.c +79 -31
- data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/admin/v3/tap.upb.h +29 -26
- data/src/core/ext/upb-gen/envoy/admin/v3/tap.upb_minitable.c +17 -11
- data/src/core/ext/upb-gen/envoy/admin/v3/tap.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/annotations/deprecation.upb.h +46 -29
- data/src/core/ext/upb-gen/envoy/annotations/deprecation.upb_minitable.c +37 -19
- data/src/core/ext/upb-gen/envoy/annotations/deprecation.upb_minitable.h +4 -4
- data/src/core/ext/upb-gen/envoy/annotations/resource.upb.h +34 -27
- data/src/core/ext/upb-gen/envoy/annotations/resource.upb_minitable.c +34 -13
- data/src/core/ext/upb-gen/envoy/annotations/resource.upb_minitable.h +1 -2
- data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb.h +617 -452
- data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb_minitable.c +221 -163
- data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb_minitable.h +0 -16
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb.h +1339 -970
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.c +484 -324
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.h +0 -23
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb.h +181 -135
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb_minitable.c +59 -43
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb_minitable.h +0 -3
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb.h +1353 -1028
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.c +535 -361
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.h +0 -25
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/filter.upb.h +37 -33
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/filter.upb_minitable.c +19 -13
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/filter.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb.h +234 -196
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb_minitable.c +77 -57
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb.h +695 -502
- data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb_minitable.c +246 -186
- data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb_minitable.h +0 -15
- data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb.h +140 -116
- data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb_minitable.c +53 -43
- data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb_minitable.h +0 -3
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb.h +363 -269
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb_minitable.c +131 -89
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb_minitable.h +0 -8
- data/src/core/ext/upb-gen/envoy/config/core/v3/backoff.upb.h +35 -31
- data/src/core/ext/upb-gen/envoy/config/core/v3/backoff.upb_minitable.c +15 -13
- data/src/core/ext/upb-gen/envoy/config/core/v3/backoff.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb.h +1073 -769
- data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb_minitable.c +515 -293
- data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb_minitable.h +0 -30
- data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb.h +25 -23
- data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb_minitable.c +15 -7
- data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/config/core/v3/config_source.upb.h +375 -267
- data/src/core/ext/upb-gen/envoy/config/core/v3/config_source.upb_minitable.c +142 -86
- data/src/core/ext/upb-gen/envoy/config/core/v3/config_source.upb_minitable.h +0 -7
- data/src/core/ext/upb-gen/envoy/config/core/v3/event_service_config.upb.h +32 -27
- data/src/core/ext/upb-gen/envoy/config/core/v3/event_service_config.upb_minitable.c +13 -11
- data/src/core/ext/upb-gen/envoy/config/core/v3/event_service_config.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/config/core/v3/extension.upb.h +29 -26
- data/src/core/ext/upb-gen/envoy/config/core/v3/extension.upb_minitable.c +17 -11
- data/src/core/ext/upb-gen/envoy/config/core/v3/extension.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_method_list.upb.h +87 -56
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_method_list.upb_minitable.c +26 -16
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_method_list.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb.h +634 -468
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb_minitable.c +255 -161
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb_minitable.h +0 -14
- data/src/core/ext/upb-gen/envoy/config/core/v3/health_check.upb.h +672 -474
- data/src/core/ext/upb-gen/envoy/config/core/v3/health_check.upb_minitable.c +228 -130
- data/src/core/ext/upb-gen/envoy/config/core/v3/health_check.upb_minitable.h +0 -9
- data/src/core/ext/upb-gen/envoy/config/core/v3/http_service.upb.h +56 -40
- data/src/core/ext/upb-gen/envoy/config/core/v3/http_service.upb_minitable.c +15 -13
- data/src/core/ext/upb-gen/envoy/config/core/v3/http_service.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/config/core/v3/http_uri.upb.h +34 -29
- data/src/core/ext/upb-gen/envoy/config/core/v3/http_uri.upb_minitable.c +19 -11
- data/src/core/ext/upb-gen/envoy/config/core/v3/http_uri.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb.h +811 -635
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.c +347 -221
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.h +0 -16
- data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb.h +174 -118
- data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb_minitable.c +62 -38
- data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb_minitable.h +0 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/resolver.upb.h +78 -57
- data/src/core/ext/upb-gen/envoy/config/core/v3/resolver.upb_minitable.c +28 -18
- data/src/core/ext/upb-gen/envoy/config/core/v3/resolver.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_cmsg_headers.upb.h +37 -33
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_cmsg_headers.upb_minitable.c +22 -14
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_cmsg_headers.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb.h +159 -119
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb_minitable.c +47 -35
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb_minitable.h +0 -5
- data/src/core/ext/upb-gen/envoy/config/core/v3/substitution_format_string.upb.h +101 -76
- data/src/core/ext/upb-gen/envoy/config/core/v3/substitution_format_string.upb_minitable.c +41 -23
- data/src/core/ext/upb-gen/envoy/config/core/v3/substitution_format_string.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/config/core/v3/udp_socket_config.upb.h +35 -31
- data/src/core/ext/upb-gen/envoy/config/core/v3/udp_socket_config.upb_minitable.c +15 -13
- data/src/core/ext/upb-gen/envoy/config/core/v3/udp_socket_config.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint.upb.h +189 -127
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint.upb_minitable.c +79 -49
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint.upb_minitable.h +0 -4
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb.h +378 -283
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.c +156 -98
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.h +0 -8
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/load_report.upb.h +354 -255
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/load_report.upb_minitable.c +125 -69
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/load_report.upb_minitable.h +0 -6
- data/src/core/ext/upb-gen/envoy/config/listener/v3/api_listener.upb.h +27 -24
- data/src/core/ext/upb-gen/envoy/config/listener/v3/api_listener.upb_minitable.c +13 -11
- data/src/core/ext/upb-gen/envoy/config/listener/v3/api_listener.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb.h +611 -451
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.c +159 -119
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.h +0 -11
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb.h +468 -321
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb_minitable.c +157 -99
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb_minitable.h +0 -6
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb.h +146 -119
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb_minitable.c +55 -35
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/config/listener/v3/udp_listener_config.upb.h +61 -51
- data/src/core/ext/upb-gen/envoy/config/listener/v3/udp_listener_config.upb_minitable.c +16 -16
- data/src/core/ext/upb-gen/envoy/config/listener/v3/udp_listener_config.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb.h +43 -39
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb_minitable.c +25 -13
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb.h +341 -247
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb_minitable.c +130 -84
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb_minitable.h +0 -8
- data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb.h +452 -313
- data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb_minitable.c +144 -100
- data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb_minitable.h +0 -10
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb.h +666 -493
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb_minitable.c +251 -181
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb_minitable.h +0 -12
- data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb.h +327 -197
- data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb_minitable.c +92 -48
- data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb_minitable.h +0 -3
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb.h +3583 -2532
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.c +1340 -816
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.h +0 -60
- data/src/core/ext/upb-gen/envoy/config/route/v3/scoped_route.upb.h +111 -82
- data/src/core/ext/upb-gen/envoy/config/route/v3/scoped_route.upb_minitable.c +48 -28
- data/src/core/ext/upb-gen/envoy/config/route/v3/scoped_route.upb_minitable.h +0 -3
- data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb.h +548 -410
- data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb_minitable.c +214 -148
- data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb_minitable.h +0 -12
- data/src/core/ext/upb-gen/envoy/config/trace/v3/datadog.upb.h +59 -50
- data/src/core/ext/upb-gen/envoy/config/trace/v3/datadog.upb_minitable.c +30 -20
- data/src/core/ext/upb-gen/envoy/config/trace/v3/datadog.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/config/trace/v3/dynamic_ot.upb.h +29 -26
- data/src/core/ext/upb-gen/envoy/config/trace/v3/dynamic_ot.upb_minitable.c +17 -11
- data/src/core/ext/upb-gen/envoy/config/trace/v3/dynamic_ot.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/config/trace/v3/http_tracer.upb.h +60 -49
- data/src/core/ext/upb-gen/envoy/config/trace/v3/http_tracer.upb_minitable.c +28 -20
- data/src/core/ext/upb-gen/envoy/config/trace/v3/http_tracer.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/config/trace/v3/lightstep.upb.h +50 -36
- data/src/core/ext/upb-gen/envoy/config/trace/v3/lightstep.upb_minitable.c +19 -11
- data/src/core/ext/upb-gen/envoy/config/trace/v3/lightstep.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb.h +82 -63
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb_minitable.c +27 -19
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/config/trace/v3/service.upb.h +27 -24
- data/src/core/ext/upb-gen/envoy/config/trace/v3/service.upb_minitable.c +13 -11
- data/src/core/ext/upb-gen/envoy/config/trace/v3/service.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/config/trace/v3/skywalking.upb.h +70 -58
- data/src/core/ext/upb-gen/envoy/config/trace/v3/skywalking.upb_minitable.c +32 -22
- data/src/core/ext/upb-gen/envoy/config/trace/v3/skywalking.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/config/trace/v3/trace.upb.h +2 -5
- data/src/core/ext/upb-gen/envoy/config/trace/v3/trace.upb_minitable.c +1 -1
- data/src/core/ext/upb-gen/envoy/config/trace/v3/xray.upb.h +73 -62
- data/src/core/ext/upb-gen/envoy/config/trace/v3/xray.upb_minitable.c +39 -25
- data/src/core/ext/upb-gen/envoy/config/trace/v3/xray.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb.h +49 -45
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb_minitable.c +33 -13
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb.h +771 -588
- data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb_minitable.c +383 -185
- data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb_minitable.h +0 -16
- data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +66 -47
- data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.c +31 -17
- data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/extensions/common/matching/v3/extension_matcher.upb.h +69 -58
- data/src/core/ext/upb-gen/envoy/extensions/common/matching/v3/extension_matcher.upb_minitable.c +27 -23
- data/src/core/ext/upb-gen/envoy/extensions/common/matching/v3/extension_matcher.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb.h +151 -119
- data/src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb_minitable.c +45 -39
- data/src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb_minitable.h +0 -5
- data/src/core/ext/upb-gen/envoy/extensions/filters/common/matcher/action/v3/skip_action.upb.h +19 -17
- data/src/core/ext/upb-gen/envoy/extensions/filters/common/matcher/action/v3/skip_action.upb_minitable.c +1 -3
- data/src/core/ext/upb-gen/envoy/extensions/filters/common/matcher/action/v3/skip_action.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/composite/v3/composite.upb.h +144 -109
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/composite/v3/composite.upb_minitable.c +46 -38
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/composite/v3/composite.upb_minitable.h +0 -4
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb.h +184 -139
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c +65 -35
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.h +0 -3
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h +129 -106
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c +69 -41
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h +0 -4
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +83 -71
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c +40 -26
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb.h +148 -101
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb_minitable.c +45 -27
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +62 -51
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c +35 -21
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +1362 -1024
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.c +508 -336
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.h +0 -22
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb.h +21 -19
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb_minitable.c +13 -7
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb.h +35 -31
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb_minitable.c +15 -13
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb.h +27 -24
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb_minitable.c +13 -11
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.h +27 -24
- data/src/core/ext/upb-gen/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb_minitable.c +13 -11
- data/src/core/ext/upb-gen/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +94 -74
- 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 +35 -23
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +231 -179
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.c +88 -66
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.h +0 -6
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb.h +21 -19
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb_minitable.c +13 -7
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +63 -56
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb_minitable.c +31 -19
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.h +27 -24
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb_minitable.c +13 -11
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upb.h +27 -24
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upb_minitable.c +13 -11
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +2 -5
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/cert.upb_minitable.c +1 -1
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb.h +538 -364
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb_minitable.c +157 -95
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb_minitable.h +0 -8
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +150 -110
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb_minitable.c +69 -49
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb_minitable.h +0 -4
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +517 -389
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb_minitable.c +182 -116
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb_minitable.h +0 -7
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h +84 -62
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb_minitable.c +30 -22
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb.h +340 -256
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.c +92 -82
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.h +0 -5
- data/src/core/ext/upb-gen/envoy/service/discovery/v3/ads.upb.h +19 -17
- data/src/core/ext/upb-gen/envoy/service/discovery/v3/ads.upb_minitable.c +1 -3
- data/src/core/ext/upb-gen/envoy/service/discovery/v3/ads.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb.h +857 -566
- data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb_minitable.c +288 -182
- data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb_minitable.h +0 -15
- data/src/core/ext/upb-gen/envoy/service/load_stats/v3/lrs.upb.h +105 -72
- data/src/core/ext/upb-gen/envoy/service/load_stats/v3/lrs.upb_minitable.c +36 -22
- data/src/core/ext/upb-gen/envoy/service/load_stats/v3/lrs.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/service/status/v3/csds.upb.h +312 -226
- data/src/core/ext/upb-gen/envoy/service/status/v3/csds.upb_minitable.c +132 -78
- data/src/core/ext/upb-gen/envoy/service/status/v3/csds.upb_minitable.h +0 -5
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb.h +82 -61
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.c +35 -19
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/type/http/v3/path_transformation.upb.h +123 -89
- data/src/core/ext/upb-gen/envoy/type/http/v3/path_transformation.upb_minitable.c +25 -25
- data/src/core/ext/upb-gen/envoy/type/http/v3/path_transformation.upb_minitable.h +0 -4
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/address.upb.h +48 -33
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/address.upb_minitable.c +13 -11
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/address.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/filter_state.upb.h +42 -36
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/filter_state.upb_minitable.c +19 -13
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/filter_state.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/http_inputs.upb.h +101 -79
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/http_inputs.upb_minitable.c +61 -31
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/http_inputs.upb_minitable.h +0 -5
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/metadata.upb.h +83 -60
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/metadata.upb_minitable.c +37 -19
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/metadata.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/node.upb.h +56 -40
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/node.upb_minitable.c +15 -13
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/node.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/number.upb.h +34 -29
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/number.upb_minitable.c +13 -11
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/number.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/path.upb.h +32 -27
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/path.upb_minitable.c +13 -11
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/path.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/regex.upb.h +88 -71
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/regex.upb_minitable.c +48 -30
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/regex.upb_minitable.h +0 -3
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb.h +37 -30
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb_minitable.c +1 -5
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/string.upb.h +95 -71
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/string.upb_minitable.c +36 -22
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/string.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/struct.upb.h +79 -56
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/struct.upb_minitable.c +26 -18
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/struct.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/value.upb.h +164 -124
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/value.upb_minitable.c +54 -40
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/value.upb_minitable.h +0 -4
- data/src/core/ext/upb-gen/envoy/type/metadata/v3/metadata.upb.h +200 -147
- data/src/core/ext/upb-gen/envoy/type/metadata/v3/metadata.upb_minitable.c +47 -41
- data/src/core/ext/upb-gen/envoy/type/metadata/v3/metadata.upb_minitable.h +0 -7
- data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb.h +160 -130
- data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb_minitable.c +89 -47
- data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb_minitable.h +0 -5
- data/src/core/ext/upb-gen/envoy/type/v3/hash_policy.upb.h +78 -62
- data/src/core/ext/upb-gen/envoy/type/v3/hash_policy.upb_minitable.c +26 -20
- data/src/core/ext/upb-gen/envoy/type/v3/hash_policy.upb_minitable.h +0 -3
- data/src/core/ext/upb-gen/envoy/type/v3/http.upb.h +2 -5
- data/src/core/ext/upb-gen/envoy/type/v3/http.upb_minitable.c +1 -1
- data/src/core/ext/upb-gen/envoy/type/v3/http_status.upb.h +21 -19
- data/src/core/ext/upb-gen/envoy/type/v3/http_status.upb_minitable.c +13 -7
- data/src/core/ext/upb-gen/envoy/type/v3/http_status.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/type/v3/percent.upb.h +43 -36
- data/src/core/ext/upb-gen/envoy/type/v3/percent.upb_minitable.c +22 -12
- data/src/core/ext/upb-gen/envoy/type/v3/percent.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/type/v3/range.upb.h +67 -55
- data/src/core/ext/upb-gen/envoy/type/v3/range.upb_minitable.c +36 -18
- data/src/core/ext/upb-gen/envoy/type/v3/range.upb_minitable.h +0 -3
- data/src/core/ext/upb-gen/envoy/type/v3/ratelimit_strategy.upb.h +62 -51
- data/src/core/ext/upb-gen/envoy/type/v3/ratelimit_strategy.upb_minitable.c +33 -19
- data/src/core/ext/upb-gen/envoy/type/v3/ratelimit_strategy.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/type/v3/ratelimit_unit.upb.h +2 -5
- data/src/core/ext/upb-gen/envoy/type/v3/ratelimit_unit.upb_minitable.c +1 -1
- data/src/core/ext/upb-gen/envoy/type/v3/semantic_version.upb.h +25 -23
- data/src/core/ext/upb-gen/envoy/type/v3/semantic_version.upb_minitable.c +15 -7
- data/src/core/ext/upb-gen/envoy/type/v3/semantic_version.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/type/v3/token_bucket.upb.h +37 -33
- data/src/core/ext/upb-gen/envoy/type/v3/token_bucket.upb_minitable.c +19 -13
- data/src/core/ext/upb-gen/envoy/type/v3/token_bucket.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/google/api/annotations.upb.h +15 -13
- data/src/core/ext/upb-gen/google/api/annotations.upb_minitable.c +22 -7
- data/src/core/ext/upb-gen/google/api/annotations.upb_minitable.h +1 -1
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb.h +619 -430
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb_minitable.c +260 -168
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb_minitable.h +0 -13
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/syntax.upb.h +734 -518
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/syntax.upb_minitable.c +312 -182
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/syntax.upb_minitable.h +0 -16
- data/src/core/ext/upb-gen/google/api/http.upb.h +146 -105
- data/src/core/ext/upb-gen/google/api/http.upb_minitable.c +65 -29
- data/src/core/ext/upb-gen/google/api/http.upb_minitable.h +0 -3
- data/src/core/ext/upb-gen/google/api/httpbody.upb.h +52 -37
- data/src/core/ext/upb-gen/google/api/httpbody.upb_minitable.c +19 -11
- data/src/core/ext/upb-gen/google/api/httpbody.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/google/protobuf/any.upb.h +23 -21
- data/src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c +15 -7
- data/src/core/ext/upb-gen/google/protobuf/any.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/google/protobuf/descriptor.upb.h +2236 -1514
- data/src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c +824 -406
- data/src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.h +0 -34
- data/src/core/ext/upb-gen/google/protobuf/duration.upb.h +23 -21
- data/src/core/ext/upb-gen/google/protobuf/duration.upb_minitable.c +15 -7
- data/src/core/ext/upb-gen/google/protobuf/duration.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/google/protobuf/empty.upb.h +19 -17
- data/src/core/ext/upb-gen/google/protobuf/empty.upb_minitable.c +1 -3
- data/src/core/ext/upb-gen/google/protobuf/empty.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/google/protobuf/struct.upb.h +149 -100
- data/src/core/ext/upb-gen/google/protobuf/struct.upb_minitable.c +59 -43
- data/src/core/ext/upb-gen/google/protobuf/struct.upb_minitable.h +0 -4
- data/src/core/ext/upb-gen/google/protobuf/timestamp.upb.h +23 -21
- data/src/core/ext/upb-gen/google/protobuf/timestamp.upb_minitable.c +15 -7
- data/src/core/ext/upb-gen/google/protobuf/timestamp.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/google/protobuf/wrappers.upb.h +181 -139
- data/src/core/ext/upb-gen/google/protobuf/wrappers.upb_minitable.c +99 -53
- data/src/core/ext/upb-gen/google/protobuf/wrappers.upb_minitable.h +0 -9
- data/src/core/ext/upb-gen/google/rpc/status.upb.h +52 -37
- data/src/core/ext/upb-gen/google/rpc/status.upb_minitable.c +19 -11
- data/src/core/ext/upb-gen/google/rpc/status.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/channelz.upb.h +1553 -1157
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/channelz.upb_minitable.c +712 -410
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/channelz.upb_minitable.h +0 -39
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb.h +189 -125
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb_minitable.c +59 -35
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb_minitable.h +0 -3
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb.h +454 -343
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.c +204 -130
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.h +0 -11
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb.h +369 -243
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb_minitable.c +109 -79
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb_minitable.h +0 -7
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/service.upb.h +256 -175
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/service.upb_minitable.c +122 -68
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/service.upb_minitable.h +0 -8
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/altscontext.upb.h +71 -51
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/altscontext.upb_minitable.c +39 -19
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/altscontext.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb.h +583 -407
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb_minitable.c +259 -145
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb_minitable.h +0 -12
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/transport_security_common.upb.h +114 -84
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/transport_security_common.upb_minitable.c +52 -30
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/transport_security_common.upb_minitable.h +0 -4
- data/src/core/ext/upb-gen/src/proto/grpc/health/v1/health.upb.h +41 -34
- data/src/core/ext/upb-gen/src/proto/grpc/health/v1/health.upb_minitable.c +25 -13
- data/src/core/ext/upb-gen/src/proto/grpc/health/v1/health.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb.h +309 -230
- data/src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb_minitable.c +123 -79
- data/src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb_minitable.h +0 -9
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb.h +98 -63
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb_minitable.c +51 -23
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb_minitable.h +0 -3
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls_config.upb.h +505 -312
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls_config.upb_minitable.c +159 -87
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls_config.upb_minitable.h +0 -9
- data/src/core/ext/upb-gen/udpa/annotations/migrate.upb.h +128 -91
- data/src/core/ext/upb-gen/udpa/annotations/migrate.upb_minitable.c +82 -41
- data/src/core/ext/upb-gen/udpa/annotations/migrate.upb_minitable.h +5 -8
- data/src/core/ext/upb-gen/udpa/annotations/security.upb.h +36 -29
- data/src/core/ext/upb-gen/udpa/annotations/security.upb_minitable.c +36 -13
- data/src/core/ext/upb-gen/udpa/annotations/security.upb_minitable.h +1 -2
- data/src/core/ext/upb-gen/udpa/annotations/sensitive.upb.h +13 -11
- data/src/core/ext/upb-gen/udpa/annotations/sensitive.upb_minitable.c +22 -7
- data/src/core/ext/upb-gen/udpa/annotations/sensitive.upb_minitable.h +1 -1
- data/src/core/ext/upb-gen/udpa/annotations/status.upb.h +36 -29
- data/src/core/ext/upb-gen/udpa/annotations/status.upb_minitable.c +36 -13
- data/src/core/ext/upb-gen/udpa/annotations/status.upb_minitable.h +1 -2
- data/src/core/ext/upb-gen/udpa/annotations/versioning.upb.h +34 -27
- data/src/core/ext/upb-gen/udpa/annotations/versioning.upb_minitable.c +34 -13
- data/src/core/ext/upb-gen/udpa/annotations/versioning.upb_minitable.h +1 -2
- data/src/core/ext/upb-gen/validate/validate.upb.h +1682 -1130
- data/src/core/ext/upb-gen/validate/validate.upb_minitable.c +587 -247
- data/src/core/ext/upb-gen/validate/validate.upb_minitable.h +4 -27
- data/src/core/ext/upb-gen/xds/annotations/v3/migrate.upb.h +128 -91
- data/src/core/ext/upb-gen/xds/annotations/v3/migrate.upb_minitable.c +82 -41
- data/src/core/ext/upb-gen/xds/annotations/v3/migrate.upb_minitable.h +5 -8
- data/src/core/ext/upb-gen/xds/annotations/v3/security.upb.h +36 -29
- data/src/core/ext/upb-gen/xds/annotations/v3/security.upb_minitable.c +36 -13
- data/src/core/ext/upb-gen/xds/annotations/v3/security.upb_minitable.h +1 -2
- data/src/core/ext/upb-gen/xds/annotations/v3/sensitive.upb.h +13 -11
- data/src/core/ext/upb-gen/xds/annotations/v3/sensitive.upb_minitable.c +22 -7
- data/src/core/ext/upb-gen/xds/annotations/v3/sensitive.upb_minitable.h +1 -1
- data/src/core/ext/upb-gen/xds/annotations/v3/status.upb.h +122 -90
- data/src/core/ext/upb-gen/xds/annotations/v3/status.upb_minitable.c +82 -39
- data/src/core/ext/upb-gen/xds/annotations/v3/status.upb_minitable.h +3 -7
- data/src/core/ext/upb-gen/xds/annotations/v3/versioning.upb.h +34 -27
- data/src/core/ext/upb-gen/xds/annotations/v3/versioning.upb_minitable.c +34 -13
- data/src/core/ext/upb-gen/xds/annotations/v3/versioning.upb_minitable.h +1 -2
- data/src/core/ext/upb-gen/xds/core/v3/authority.upb.h +21 -19
- data/src/core/ext/upb-gen/xds/core/v3/authority.upb_minitable.c +13 -7
- data/src/core/ext/upb-gen/xds/core/v3/authority.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/xds/core/v3/cidr.upb.h +29 -26
- data/src/core/ext/upb-gen/xds/core/v3/cidr.upb_minitable.c +17 -11
- data/src/core/ext/upb-gen/xds/core/v3/cidr.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/xds/core/v3/collection_entry.upb.h +70 -58
- data/src/core/ext/upb-gen/xds/core/v3/collection_entry.upb_minitable.c +32 -22
- data/src/core/ext/upb-gen/xds/core/v3/collection_entry.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/xds/core/v3/context_params.upb.h +53 -34
- data/src/core/ext/upb-gen/xds/core/v3/context_params.upb_minitable.c +26 -16
- data/src/core/ext/upb-gen/xds/core/v3/context_params.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/xds/core/v3/extension.upb.h +29 -26
- data/src/core/ext/upb-gen/xds/core/v3/extension.upb_minitable.c +17 -11
- data/src/core/ext/upb-gen/xds/core/v3/extension.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/xds/core/v3/resource.upb.h +37 -33
- data/src/core/ext/upb-gen/xds/core/v3/resource.upb_minitable.c +22 -14
- data/src/core/ext/upb-gen/xds/core/v3/resource.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/xds/core/v3/resource_locator.upb.h +102 -76
- data/src/core/ext/upb-gen/xds/core/v3/resource_locator.upb_minitable.c +43 -23
- data/src/core/ext/upb-gen/xds/core/v3/resource_locator.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/xds/core/v3/resource_name.upb.h +33 -30
- data/src/core/ext/upb-gen/xds/core/v3/resource_name.upb_minitable.c +19 -11
- data/src/core/ext/upb-gen/xds/core/v3/resource_name.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/xds/data/orca/v3/orca_load_report.upb.h +136 -83
- data/src/core/ext/upb-gen/xds/data/orca/v3/orca_load_report.upb_minitable.c +41 -33
- data/src/core/ext/upb-gen/xds/data/orca/v3/orca_load_report.upb_minitable.h +0 -4
- data/src/core/ext/upb-gen/xds/service/orca/v3/orca.upb.h +46 -32
- data/src/core/ext/upb-gen/xds/service/orca/v3/orca.upb_minitable.c +20 -12
- data/src/core/ext/upb-gen/xds/service/orca/v3/orca.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb.h +29 -26
- data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb_minitable.c +20 -12
- data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/domain.upb.h +93 -61
- data/src/core/ext/upb-gen/xds/type/matcher/v3/domain.upb_minitable.c +28 -20
- data/src/core/ext/upb-gen/xds/type/matcher/v3/domain.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb.h +19 -17
- data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb_minitable.c +1 -3
- data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/ip.upb.h +105 -71
- data/src/core/ext/upb-gen/xds/type/matcher/v3/ip.upb_minitable.c +32 -22
- data/src/core/ext/upb-gen/xds/type/matcher/v3/ip.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb.h +430 -314
- data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb_minitable.c +153 -123
- data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb_minitable.h +0 -10
- data/src/core/ext/upb-gen/xds/type/matcher/v3/range.upb.h +307 -199
- data/src/core/ext/upb-gen/xds/type/matcher/v3/range.upb_minitable.c +74 -62
- data/src/core/ext/upb-gen/xds/type/matcher/v3/range.upb_minitable.h +0 -6
- data/src/core/ext/upb-gen/xds/type/matcher/v3/regex.upb.h +52 -42
- data/src/core/ext/upb-gen/xds/type/matcher/v3/regex.upb_minitable.c +19 -13
- data/src/core/ext/upb-gen/xds/type/matcher/v3/regex.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb.h +95 -71
- data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb_minitable.c +36 -22
- data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/xds/type/v3/cel.upb.h +92 -77
- data/src/core/ext/upb-gen/xds/type/v3/cel.upb_minitable.c +42 -28
- data/src/core/ext/upb-gen/xds/type/v3/cel.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/xds/type/v3/range.upb.h +67 -55
- data/src/core/ext/upb-gen/xds/type/v3/range.upb_minitable.c +36 -18
- data/src/core/ext/upb-gen/xds/type/v3/range.upb_minitable.h +0 -3
- data/src/core/ext/upb-gen/xds/type/v3/typed_struct.upb.h +29 -26
- data/src/core/ext/upb-gen/xds/type/v3/typed_struct.upb_minitable.c +17 -11
- data/src/core/ext/upb-gen/xds/type/v3/typed_struct.upb_minitable.h +0 -1
- data/src/core/ext/upbdefs-gen/google/protobuf/descriptor.upbdefs.c +885 -855
- data/src/core/filter/composite/composite_filter.cc +10 -3
- data/src/core/filter/composite/composite_filter.h +11 -1
- data/src/core/filter/filter_args.h +4 -22
- data/src/core/handshaker/handshaker.cc +10 -2
- data/src/core/handshaker/security/secure_endpoint.cc +60 -5
- data/src/core/lib/channel/channel_args.h +12 -6
- data/src/core/lib/channel/channel_stack.cc +1 -2
- data/src/core/lib/channel/channel_stack.h +1 -7
- data/src/core/lib/channel/channel_stack_builder_impl.cc +1 -1
- data/src/core/lib/channel/channel_stack_builder_impl.h +0 -7
- data/src/core/lib/channel/promise_based_filter.cc +90 -4
- data/src/core/lib/channel/promise_based_filter.h +241 -188
- data/src/core/lib/event_engine/extensions/chaotic_good_extension.h +0 -13
- data/src/core/lib/event_engine/extensions/receive_coalescing_extension.h +44 -0
- data/src/core/lib/event_engine/extensions/tcp_trace.h +1 -1
- data/src/core/lib/event_engine/posix.h +2 -0
- data/src/core/lib/event_engine/posix_engine/native_posix_dns_resolver.cc +2 -1
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +11 -8
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +9 -18
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +1 -1
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +2 -1
- data/src/core/lib/event_engine/posix_engine/posix_interface_posix.cc +10 -10
- data/src/core/lib/event_engine/posix_engine/posix_write_event_sink.h +1 -1
- data/src/core/lib/event_engine/shim.cc +2 -16
- data/src/core/lib/event_engine/shim.h +0 -4
- data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc +1 -1
- data/src/core/lib/event_engine/windows/native_windows_dns_resolver.cc +5 -4
- data/src/core/lib/experiments/experiments.cc +303 -183
- data/src/core/lib/experiments/experiments.h +166 -90
- data/src/core/lib/iomgr/buffer_list.h +1 -1
- data/src/core/lib/iomgr/error.cc +3 -73
- data/src/core/lib/iomgr/error.h +8 -6
- data/src/core/lib/iomgr/error_cfstream.cc +1 -2
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +3 -7
- data/src/core/lib/iomgr/ev_poll_posix.cc +2 -6
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +2 -2
- data/src/core/lib/iomgr/tcp_posix.cc +4 -7
- data/src/core/lib/iomgr/tcp_server_posix.cc +3 -3
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +1 -1
- data/src/core/lib/promise/detail/promise_factory.h +8 -8
- data/src/core/lib/promise/interceptor_list.h +1 -1
- data/src/core/lib/promise/try_seq.h +2 -2
- data/src/core/lib/resource_quota/telemetry.cc +54 -0
- data/src/core/lib/resource_quota/telemetry.h +5 -23
- data/src/core/lib/security/authorization/audit_logging.cc +2 -2
- data/src/core/lib/security/authorization/audit_logging.h +3 -3
- data/src/core/lib/security/authorization/grpc_authorization_engine.cc +11 -13
- data/src/core/lib/security/authorization/grpc_authorization_engine.h +1 -1
- data/src/core/lib/security/authorization/matchers.cc +20 -20
- data/src/core/lib/security/authorization/matchers.h +15 -16
- data/src/core/lib/security/authorization/rbac_policy.h +1 -1
- data/src/core/lib/security/authorization/stdout_logger.cc +3 -3
- data/src/core/lib/security/authorization/stdout_logger.h +6 -5
- data/src/core/lib/surface/call.cc +6 -9
- data/src/core/lib/surface/call.h +11 -0
- data/src/core/lib/surface/channel.cc +21 -2
- data/src/core/lib/surface/channel.h +14 -6
- data/src/core/lib/surface/filter_stack_call.cc +10 -29
- data/src/core/lib/surface/legacy_channel.cc +7 -7
- data/src/core/lib/surface/legacy_channel.h +3 -1
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/bdp_estimator.cc +13 -13
- data/src/core/lib/transport/bdp_estimator.h +9 -5
- data/src/core/lib/transport/error_utils.cc +26 -138
- data/src/core/lib/transport/promise_endpoint.h +8 -8
- data/src/core/lib/transport/transport.h +31 -4
- data/src/core/load_balancing/grpclb/grpclb.cc +2 -1
- data/src/core/load_balancing/pick_first/pick_first.cc +33 -2
- data/src/core/load_balancing/pick_first/pick_first.h +6 -0
- data/src/core/load_balancing/ring_hash/ring_hash.cc +3 -10
- data/src/core/load_balancing/rls/rls.cc +2 -1
- data/src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc +141 -74
- data/src/core/load_balancing/weighted_round_robin/weighted_round_robin.h +88 -0
- data/src/core/load_balancing/xds/cds.cc +80 -56
- data/src/core/load_balancing/xds/cds.h +21 -0
- data/src/core/mitigation_engine/mitigation.h +53 -0
- data/src/core/mitigation_engine/mitigation_engine.h +81 -0
- data/src/core/mitigation_engine/mitigation_provider.h +62 -0
- data/src/core/plugin_registry/grpc_plugin_registry.cc +0 -2
- data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +0 -5
- data/src/core/resolver/dns/dns_resolver_plugin.cc +1 -6
- data/src/core/resolver/xds/xds_resolver.cc +37 -144
- data/src/core/server/server.cc +40 -18
- data/src/core/server/server.h +26 -18
- data/src/core/server/server_config_selector.h +5 -4
- data/src/core/server/server_config_selector_filter.cc +135 -26
- data/src/core/server/server_config_selector_filter.h +1 -0
- data/src/core/server/xds_server_config_fetcher.cc +687 -692
- data/src/core/server/xds_server_config_fetcher_legacy.cc +1336 -0
- data/src/core/telemetry/call_tracer.cc +49 -2
- data/src/core/telemetry/call_tracer.h +1 -0
- data/src/core/telemetry/histogram.h +10 -89
- data/src/core/telemetry/instrument.h +42 -28
- data/src/core/telemetry/tcp_tracer.h +38 -0
- data/src/core/transport/message_size_service_config.cc +123 -0
- data/src/core/transport/message_size_service_config.h +85 -0
- data/src/core/transport/session_endpoint.cc +29 -4
- data/src/core/transport/session_endpoint.h +4 -0
- data/src/core/tsi/alts/crypt/gsec.h +4 -2
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +1 -1
- data/src/core/tsi/ssl_telemetry_utils.cc +343 -0
- data/src/core/tsi/ssl_telemetry_utils.h +74 -0
- data/src/core/tsi/ssl_transport_security.cc +583 -305
- data/src/core/tsi/ssl_transport_security.h +22 -6
- data/src/core/tsi/ssl_transport_security_utils.cc +2 -0
- data/src/core/tsi/transport_security.h +7 -0
- data/src/core/util/http_client/httpcli.cc +1 -4
- data/src/core/util/http_client/httpcli_security_connector.cc +2 -1
- data/src/core/util/http_client/parser.cc +1 -1
- data/src/core/util/lru_cache.h +2 -0
- data/src/core/util/ref_counted_string.h +1 -1
- data/src/core/util/status_helper.cc +71 -192
- data/src/core/util/status_helper.h +16 -21
- data/src/core/util/tchar.cc +13 -7
- data/src/core/util/trie_lookup.h +1 -1
- data/src/core/xds/grpc/blackboard.cc +58 -0
- data/src/core/{filter → xds/grpc}/blackboard.h +30 -11
- data/src/core/xds/grpc/file_watcher_certificate_provider_factory.cc +2 -11
- data/src/core/xds/grpc/xds_bootstrap_grpc.cc +2 -7
- data/src/core/xds/grpc/xds_cluster_parser.cc +5 -16
- data/src/core/xds/grpc/xds_common_types.cc +96 -0
- data/src/core/xds/grpc/xds_common_types.h +35 -7
- data/src/core/xds/grpc/xds_common_types_parser.cc +205 -134
- data/src/core/xds/grpc/xds_common_types_parser.h +18 -1
- data/src/core/xds/grpc/xds_endpoint_parser.cc +7 -18
- data/src/core/xds/grpc/xds_http_composite_filter.cc +34 -18
- data/src/core/xds/grpc/xds_http_composite_filter.h +6 -3
- data/src/core/xds/grpc/xds_http_fault_filter.cc +0 -149
- data/src/core/xds/grpc/xds_http_fault_filter.h +19 -8
- data/src/core/xds/grpc/xds_http_filter.cc +2 -1
- data/src/core/xds/grpc/xds_http_filter.h +6 -16
- data/src/core/xds/grpc/xds_http_filter_registry.cc +2 -12
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.cc +25 -119
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.h +27 -15
- data/src/core/xds/grpc/xds_http_rbac_filter.cc +3 -12
- data/src/core/xds/grpc/xds_http_stateful_session_filter.cc +0 -149
- data/src/core/xds/grpc/xds_http_stateful_session_filter.h +19 -8
- data/src/core/xds/grpc/xds_lb_policy_registry.cc +18 -0
- data/src/core/xds/grpc/xds_listener_parser.cc +13 -9
- data/src/core/xds/grpc/xds_metadata_parser.cc +0 -2
- data/src/core/xds/grpc/xds_route_config.h +1 -1
- data/src/core/xds/grpc/xds_route_config_parser.cc +10 -16
- data/src/core/xds/grpc/xds_routing.cc +115 -90
- data/src/core/xds/grpc/xds_routing.h +73 -24
- data/src/core/xds/grpc/xds_server_grpc.cc +22 -13
- data/src/core/xds/grpc/xds_server_grpc.h +16 -2
- data/src/core/xds/grpc/xds_server_grpc_interface.h +10 -0
- data/src/core/xds/grpc/xds_transport_grpc.cc +123 -18
- data/src/core/xds/grpc/xds_transport_grpc.h +28 -4
- data/src/core/xds/xds_client/lrs_client.cc +4 -8
- data/src/core/xds/xds_client/xds_bootstrap.cc +4 -16
- data/src/core/xds/xds_client/xds_client.cc +2 -15
- data/src/core/xds/xds_client/xds_transport.h +3 -0
- data/src/ruby/ext/grpc/rb_byte_buffer.c +1 -0
- data/src/ruby/ext/grpc/rb_call.c +3 -0
- data/src/ruby/ext/grpc/rb_call_credentials.c +1 -0
- data/src/ruby/ext/grpc/rb_channel.c +1 -0
- data/src/ruby/ext/grpc/rb_channel_args.c +1 -0
- data/src/ruby/ext/grpc/rb_channel_credentials.c +1 -0
- data/src/ruby/ext/grpc/rb_completion_queue.c +1 -0
- data/src/ruby/ext/grpc/rb_compression_options.c +1 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +4 -4
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +6 -6
- data/src/ruby/ext/grpc/rb_server.c +1 -0
- data/src/ruby/ext/grpc/rb_server_credentials.c +1 -0
- data/src/ruby/ext/grpc/rb_xds_channel_credentials.c +1 -0
- data/src/ruby/ext/grpc/rb_xds_server_credentials.c +1 -0
- data/src/ruby/lib/grpc/core/call_credentials.rb +86 -0
- data/src/ruby/lib/grpc/core/channel_credentials.rb +69 -0
- data/src/ruby/lib/grpc/core/credentials_helper.rb +126 -0
- data/src/ruby/lib/grpc/generic/client_stub.rb +86 -73
- data/src/ruby/lib/grpc/generic/interceptors.rb +1 -1
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/lib/grpc.rb +25 -0
- data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +1 -1
- data/src/ruby/spec/call_credentials_spec.rb +52 -2
- data/src/ruby/spec/credentials_helper_spec.rb +80 -0
- data/src/ruby/spec/generic/client_stub_spec.rb +27 -4
- data/src/ruby/spec/generic/server_interceptors_spec.rb +17 -3
- data/third_party/upb/upb/base/error_handler.h +79 -0
- data/third_party/upb/upb/base/internal/log2.h +29 -5
- data/third_party/upb/upb/generated_code_support.h +1 -0
- data/third_party/upb/upb/hash/common.c +129 -14
- data/third_party/upb/upb/hash/common.h +1 -1
- data/third_party/upb/upb/hash/ext_table.h +65 -0
- data/third_party/upb/upb/lex/strtod.c +14 -5
- data/third_party/upb/upb/mem/arena.c +113 -95
- data/third_party/upb/upb/mem/internal/arena.h +13 -8
- data/third_party/upb/upb/message/accessors.c +2 -3
- data/third_party/upb/upb/message/accessors.h +32 -12
- data/third_party/upb/upb/message/array.c +51 -2
- data/third_party/upb/upb/message/array.h +10 -0
- data/third_party/upb/upb/message/copy.c +18 -34
- data/third_party/upb/upb/message/internal/accessors.h +15 -49
- data/third_party/upb/upb/message/internal/array.h +1 -1
- data/third_party/upb/upb/message/internal/map.h +1 -1
- data/third_party/upb/upb/message/internal/message.c +8 -1
- data/third_party/upb/upb/message/internal/message.h +40 -10
- data/third_party/upb/upb/message/message.c +3 -2
- data/third_party/upb/upb/message/value.h +0 -6
- data/third_party/upb/upb/mini_descriptor/decode.c +78 -59
- data/third_party/upb/upb/mini_descriptor/link.c +8 -6
- data/third_party/upb/upb/mini_table/extension_registry.c +17 -49
- data/third_party/upb/upb/mini_table/extension_registry.h +5 -17
- data/third_party/upb/upb/mini_table/generated_registry.c +180 -0
- data/third_party/upb/upb/mini_table/generated_registry.h +66 -0
- data/third_party/upb/upb/mini_table/internal/extension.h +5 -3
- data/third_party/upb/upb/mini_table/internal/field.h +7 -5
- data/third_party/upb/upb/mini_table/internal/generated_registry.h +37 -0
- data/third_party/upb/upb/mini_table/internal/message.c +0 -18
- data/third_party/upb/upb/mini_table/internal/message.h +24 -41
- data/third_party/upb/upb/mini_table/internal/size_log2.h +2 -1
- data/third_party/upb/upb/mini_table/internal/sub.h +2 -5
- data/third_party/upb/upb/mini_table/message.h +34 -13
- data/third_party/upb/upb/port/atomic.h +180 -74
- data/third_party/upb/upb/port/def.inc +194 -29
- data/third_party/upb/upb/port/sanitizers.h +15 -0
- data/third_party/upb/upb/port/undef.inc +6 -2
- data/third_party/upb/upb/reflection/common.h +0 -6
- data/third_party/upb/upb/reflection/def.hpp +8 -12
- data/third_party/upb/upb/reflection/def_pool.c +85 -33
- data/third_party/upb/upb/reflection/def_pool.h +38 -8
- data/third_party/upb/upb/reflection/def_type.h +3 -0
- data/third_party/upb/upb/reflection/enum_def.c +45 -33
- data/third_party/upb/upb/reflection/enum_def.h +8 -4
- data/third_party/upb/upb/reflection/enum_reserved_range.c +7 -3
- data/third_party/upb/upb/reflection/enum_value_def.c +14 -29
- data/third_party/upb/upb/reflection/enum_value_def.h +5 -4
- data/third_party/upb/upb/reflection/extension_range.c +15 -14
- data/third_party/upb/upb/reflection/extension_range.h +7 -4
- data/third_party/upb/upb/reflection/field_def.c +114 -96
- data/third_party/upb/upb/reflection/field_def.h +3 -3
- data/third_party/upb/upb/reflection/file_def.c +71 -65
- data/third_party/upb/upb/reflection/file_def.h +4 -5
- data/third_party/upb/upb/reflection/internal/def_builder.c +22 -14
- data/third_party/upb/upb/reflection/internal/def_builder.h +44 -38
- data/third_party/upb/upb/reflection/internal/def_pool.h +5 -1
- data/third_party/upb/upb/reflection/internal/enum_def.h +6 -4
- data/third_party/upb/upb/reflection/internal/enum_reserved_range.h +3 -2
- data/third_party/upb/upb/reflection/internal/enum_value_def.h +7 -4
- data/third_party/upb/upb/reflection/internal/extension_range.h +4 -3
- data/third_party/upb/upb/reflection/internal/field_def.h +15 -12
- data/third_party/upb/upb/reflection/internal/file_def.h +8 -1
- data/third_party/upb/upb/reflection/internal/message_def.h +10 -7
- data/third_party/upb/upb/reflection/internal/message_reserved_range.h +3 -1
- data/third_party/upb/upb/reflection/internal/method_def.h +6 -6
- data/third_party/upb/upb/reflection/internal/oneof_def.h +6 -6
- data/third_party/upb/upb/reflection/internal/service_def.h +9 -6
- data/third_party/upb/upb/reflection/internal/upb_edition_defaults.h +1 -1
- data/third_party/upb/upb/reflection/message_def.c +46 -53
- data/third_party/upb/upb/reflection/message_def.h +6 -7
- data/third_party/upb/upb/reflection/message_reserved_range.c +7 -6
- data/third_party/upb/upb/reflection/method_def.c +22 -20
- data/third_party/upb/upb/reflection/method_def.h +4 -4
- data/third_party/upb/upb/reflection/oneof_def.c +17 -15
- data/third_party/upb/upb/reflection/oneof_def.h +6 -3
- data/third_party/upb/upb/reflection/service_def.c +50 -23
- data/third_party/upb/upb/reflection/service_def.h +7 -4
- data/third_party/upb/upb/text/internal/encode.c +7 -10
- data/third_party/upb/upb/wire/decode.c +269 -430
- data/third_party/upb/upb/wire/decode.h +6 -45
- data/third_party/upb/upb/wire/decode_fast/combinations.h +7 -3
- data/third_party/upb/upb/wire/decode_fast/select.c +7 -2
- data/third_party/upb/upb/wire/encode.c +144 -106
- data/third_party/upb/upb/wire/encode.h +6 -2
- data/third_party/upb/upb/wire/eps_copy_input_stream.c +36 -7
- data/third_party/upb/upb/wire/eps_copy_input_stream.h +94 -380
- data/third_party/upb/upb/wire/internal/decoder.c +1 -14
- data/third_party/upb/upb/wire/internal/decoder.h +84 -24
- data/third_party/upb/upb/wire/internal/eps_copy_input_stream.h +339 -0
- data/third_party/upb/upb/wire/internal/reader.h +29 -12
- data/third_party/upb/upb/wire/reader.c +35 -22
- data/third_party/upb/upb/wire/reader.h +11 -18
- data/third_party/utf8_range/utf8_range.c +1 -1
- data/third_party/utf8_range/utf8_range.h +2 -1
- metadata +35 -13
- data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.cc +0 -117
- data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.h +0 -109
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_service_config_parser.cc +0 -80
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_service_config_parser.h +0 -86
- data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.cc +0 -83
- data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h +0 -91
- data/src/core/ext/transport/chttp2/transport/incoming_metadata_tracker.h +0 -217
- data/third_party/upb/upb/message/internal/tagged_ptr.h +0 -56
- data/third_party/upb/upb/message/tagged_ptr.h +0 -48
|
@@ -0,0 +1,2073 @@
|
|
|
1
|
+
//
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2024 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
|
+
#include "src/core/ext/transport/chttp2/transport/http2_server_transport.h"
|
|
20
|
+
|
|
21
|
+
#include <grpc/event_engine/event_engine.h>
|
|
22
|
+
#include <grpc/grpc.h>
|
|
23
|
+
#include <grpc/support/port_platform.h>
|
|
24
|
+
#include <limits.h>
|
|
25
|
+
|
|
26
|
+
#include <algorithm>
|
|
27
|
+
#include <cstddef>
|
|
28
|
+
#include <cstdint>
|
|
29
|
+
#include <iterator>
|
|
30
|
+
#include <memory>
|
|
31
|
+
#include <optional>
|
|
32
|
+
#include <string>
|
|
33
|
+
#include <type_traits>
|
|
34
|
+
#include <utility>
|
|
35
|
+
#include <variant>
|
|
36
|
+
#include <vector>
|
|
37
|
+
|
|
38
|
+
#include "src/core/call/call_destination.h"
|
|
39
|
+
#include "src/core/call/call_spine.h"
|
|
40
|
+
#include "src/core/call/message.h"
|
|
41
|
+
#include "src/core/call/metadata.h"
|
|
42
|
+
#include "src/core/call/metadata_batch.h"
|
|
43
|
+
#include "src/core/channelz/channelz.h"
|
|
44
|
+
#include "src/core/ext/transport/chttp2/transport/flow_control.h"
|
|
45
|
+
#include "src/core/ext/transport/chttp2/transport/flow_control_manager.h"
|
|
46
|
+
#include "src/core/ext/transport/chttp2/transport/frame.h"
|
|
47
|
+
#include "src/core/ext/transport/chttp2/transport/goaway.h"
|
|
48
|
+
#include "src/core/ext/transport/chttp2/transport/header_assembler.h"
|
|
49
|
+
#include "src/core/ext/transport/chttp2/transport/hpack_encoder.h"
|
|
50
|
+
#include "src/core/ext/transport/chttp2/transport/hpack_parser.h"
|
|
51
|
+
#include "src/core/ext/transport/chttp2/transport/http2_settings.h"
|
|
52
|
+
#include "src/core/ext/transport/chttp2/transport/http2_settings_promises.h"
|
|
53
|
+
#include "src/core/ext/transport/chttp2/transport/http2_status.h"
|
|
54
|
+
#include "src/core/ext/transport/chttp2/transport/http2_transport.h"
|
|
55
|
+
#include "src/core/ext/transport/chttp2/transport/http2_ztrace_collector.h"
|
|
56
|
+
#include "src/core/ext/transport/chttp2/transport/keepalive.h"
|
|
57
|
+
#include "src/core/ext/transport/chttp2/transport/message_assembler.h"
|
|
58
|
+
#include "src/core/ext/transport/chttp2/transport/ping_promise.h"
|
|
59
|
+
#include "src/core/ext/transport/chttp2/transport/read_context.h"
|
|
60
|
+
#include "src/core/ext/transport/chttp2/transport/security_frame.h"
|
|
61
|
+
#include "src/core/ext/transport/chttp2/transport/stream.h"
|
|
62
|
+
#include "src/core/ext/transport/chttp2/transport/stream_data_queue.h"
|
|
63
|
+
#include "src/core/ext/transport/chttp2/transport/transport_common.h"
|
|
64
|
+
#include "src/core/lib/channel/channel_args.h"
|
|
65
|
+
#include "src/core/lib/debug/trace_impl.h"
|
|
66
|
+
#include "src/core/lib/iomgr/closure.h"
|
|
67
|
+
#include "src/core/lib/iomgr/exec_ctx.h"
|
|
68
|
+
#include "src/core/lib/promise/for_each.h"
|
|
69
|
+
#include "src/core/lib/promise/if.h"
|
|
70
|
+
#include "src/core/lib/promise/loop.h"
|
|
71
|
+
#include "src/core/lib/promise/map.h"
|
|
72
|
+
#include "src/core/lib/promise/match_promise.h"
|
|
73
|
+
#include "src/core/lib/promise/party.h"
|
|
74
|
+
#include "src/core/lib/promise/poll.h"
|
|
75
|
+
#include "src/core/lib/promise/promise.h"
|
|
76
|
+
#include "src/core/lib/promise/race.h"
|
|
77
|
+
#include "src/core/lib/promise/sleep.h"
|
|
78
|
+
#include "src/core/lib/promise/try_seq.h"
|
|
79
|
+
#include "src/core/lib/resource_quota/arena.h"
|
|
80
|
+
#include "src/core/lib/resource_quota/resource_quota.h"
|
|
81
|
+
#include "src/core/lib/slice/slice.h"
|
|
82
|
+
#include "src/core/lib/slice/slice_buffer.h"
|
|
83
|
+
#include "src/core/lib/transport/connectivity_state.h"
|
|
84
|
+
#include "src/core/lib/transport/promise_endpoint.h"
|
|
85
|
+
#include "src/core/lib/transport/transport.h"
|
|
86
|
+
#include "src/core/util/debug_location.h"
|
|
87
|
+
#include "src/core/util/grpc_check.h"
|
|
88
|
+
#include "src/core/util/latent_see.h"
|
|
89
|
+
#include "src/core/util/orphanable.h"
|
|
90
|
+
#include "src/core/util/ref_counted.h"
|
|
91
|
+
#include "src/core/util/ref_counted_ptr.h"
|
|
92
|
+
#include "src/core/util/sync.h"
|
|
93
|
+
#include "src/core/util/time.h"
|
|
94
|
+
#include "absl/container/flat_hash_map.h"
|
|
95
|
+
#include "absl/functional/any_invocable.h"
|
|
96
|
+
#include "absl/log/log.h"
|
|
97
|
+
#include "absl/status/status.h"
|
|
98
|
+
#include "absl/strings/cord.h"
|
|
99
|
+
#include "absl/strings/str_cat.h"
|
|
100
|
+
#include "absl/strings/string_view.h"
|
|
101
|
+
#include "absl/types/span.h"
|
|
102
|
+
|
|
103
|
+
namespace grpc_core {
|
|
104
|
+
namespace http2 {
|
|
105
|
+
|
|
106
|
+
using grpc_event_engine::experimental::EventEngine;
|
|
107
|
+
using StreamWritabilityUpdate =
|
|
108
|
+
StreamDataQueue<ServerMetadataHandle>::StreamWritabilityUpdate;
|
|
109
|
+
|
|
110
|
+
// Experimental : This is just the initial skeleton of class
|
|
111
|
+
// and it is functions. The code will be written iteratively.
|
|
112
|
+
// Do not use or edit any of these functions unless you are
|
|
113
|
+
// familiar with the PH2 project (Moving chttp2 to promises.)
|
|
114
|
+
// TODO(tjagtap) : [PH2][P3] : Delete this comment after CHTTP2 deletion.
|
|
115
|
+
|
|
116
|
+
constexpr bool kIsClient = false;
|
|
117
|
+
|
|
118
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
119
|
+
// Channelz and ZTrace
|
|
120
|
+
|
|
121
|
+
RefCountedPtr<channelz::SocketNode> Http2ServerTransport::GetSocketNode()
|
|
122
|
+
const {
|
|
123
|
+
const channelz::BaseNode* node = channelz::DataSource::channelz_node();
|
|
124
|
+
if (node == nullptr) {
|
|
125
|
+
return nullptr;
|
|
126
|
+
}
|
|
127
|
+
return const_cast<channelz::BaseNode*>(node)
|
|
128
|
+
->RefAsSubclass<channelz::SocketNode>();
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
void Http2ServerTransport::AddData(channelz::DataSink sink) {
|
|
132
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::AddData Begin";
|
|
133
|
+
|
|
134
|
+
event_engine_->Run([self = RefAsSubclass<Http2ServerTransport>(),
|
|
135
|
+
sink = std::move(sink)]() mutable {
|
|
136
|
+
RefCountedPtr<Party> party = nullptr;
|
|
137
|
+
{
|
|
138
|
+
MutexLock lock(&self->transport_mutex_);
|
|
139
|
+
if (GPR_LIKELY(!self->is_transport_closed_)) {
|
|
140
|
+
GRPC_DCHECK(self->general_party_ != nullptr);
|
|
141
|
+
party = self->general_party_;
|
|
142
|
+
} else {
|
|
143
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
144
|
+
<< "Http2ServerTransport::AddData Transport is closed.";
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
ExecCtx exec_ctx;
|
|
149
|
+
if (party != nullptr) {
|
|
150
|
+
self->SpawnAddChannelzData(std::move(party), std::move(sink));
|
|
151
|
+
}
|
|
152
|
+
self.reset(); // Cleanup with exec_ctx in scope
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
void Http2ServerTransport::SpawnAddChannelzData(RefCountedPtr<Party> party,
|
|
157
|
+
channelz::DataSink sink) {
|
|
158
|
+
SpawnInfallible(
|
|
159
|
+
std::move(party), "AddData",
|
|
160
|
+
[self = RefAsSubclass<Http2ServerTransport>(),
|
|
161
|
+
sink = std::move(sink)]() mutable {
|
|
162
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::SpawnAddChannelzData";
|
|
163
|
+
sink.AddData(
|
|
164
|
+
"Http2ServerTransport",
|
|
165
|
+
channelz::PropertyList()
|
|
166
|
+
.Set("keepalive_time", self->keepalive_time_)
|
|
167
|
+
.Set("keepalive_permit_without_calls",
|
|
168
|
+
self->keepalive_permit_without_calls_)
|
|
169
|
+
.Set("max_requests_per_read",
|
|
170
|
+
self->read_context_.max_new_streams_per_read_cycle())
|
|
171
|
+
.Set("settings", self->settings_->ChannelzProperties())
|
|
172
|
+
.Set("flow_control",
|
|
173
|
+
self->flow_control_.stats().ChannelzProperties()));
|
|
174
|
+
self->general_party_->ExportToChannelz("Http2ServerTransport Party",
|
|
175
|
+
sink);
|
|
176
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
177
|
+
<< "Http2ServerTransport::SpawnAddChannelzData End";
|
|
178
|
+
return Empty{};
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
183
|
+
// Watchers
|
|
184
|
+
|
|
185
|
+
void Http2ServerTransport::StartWatch(RefCountedPtr<StateWatcher> watcher) {
|
|
186
|
+
MutexLock lock(&transport_mutex_);
|
|
187
|
+
GRPC_CHECK(watcher_ == nullptr);
|
|
188
|
+
watcher_ = std::move(watcher);
|
|
189
|
+
if (is_transport_closed_) {
|
|
190
|
+
// TODO(tjagtap) : [PH2][P2] : Provide better status message and
|
|
191
|
+
// disconnect info here.
|
|
192
|
+
NotifyStateWatcherOnDisconnectLocked(
|
|
193
|
+
absl::UnknownError("transport closed before watcher started"), {});
|
|
194
|
+
} else {
|
|
195
|
+
// TODO(tjagtap) : [PH2][P2] : Notify the state watcher of the current
|
|
196
|
+
// value of the peer's MAX_CONCURRENT_STREAMS setting.
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
void Http2ServerTransport::StopWatch(RefCountedPtr<StateWatcher> watcher) {
|
|
201
|
+
MutexLock lock(&transport_mutex_);
|
|
202
|
+
if (watcher_ == watcher) watcher_.reset();
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
void Http2ServerTransport::StartConnectivityWatch(
|
|
206
|
+
grpc_connectivity_state state,
|
|
207
|
+
OrphanablePtr<ConnectivityStateWatcherInterface> watcher) {
|
|
208
|
+
MutexLock lock(&transport_mutex_);
|
|
209
|
+
state_tracker_.AddWatcher(state, std::move(watcher));
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
void Http2ServerTransport::StopConnectivityWatch(
|
|
213
|
+
ConnectivityStateWatcherInterface* watcher) {
|
|
214
|
+
MutexLock lock(&transport_mutex_);
|
|
215
|
+
state_tracker_.RemoveWatcher(watcher);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
void Http2ServerTransport::NotifyStateWatcherOnDisconnectLocked(
|
|
219
|
+
absl::Status status, StateWatcher::DisconnectInfo disconnect_info) {
|
|
220
|
+
if (watcher_ == nullptr) return;
|
|
221
|
+
event_engine_->Run([watcher = std::move(watcher_), status = std::move(status),
|
|
222
|
+
disconnect_info]() mutable {
|
|
223
|
+
ExecCtx exec_ctx;
|
|
224
|
+
watcher->OnDisconnect(std::move(status), disconnect_info);
|
|
225
|
+
watcher.reset(); // Before ExecCtx goes out of scope.
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
230
|
+
// Test Only Functions
|
|
231
|
+
|
|
232
|
+
int64_t Http2ServerTransport::TestOnlyTransportFlowControlWindow() {
|
|
233
|
+
return flow_control_.remote_window();
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
int64_t Http2ServerTransport::TestOnlyGetStreamFlowControlWindow(
|
|
237
|
+
const uint32_t stream_id) {
|
|
238
|
+
RefCountedPtr<Stream> stream = LookupStream(stream_id);
|
|
239
|
+
if (stream == nullptr) {
|
|
240
|
+
return -1;
|
|
241
|
+
}
|
|
242
|
+
return stream->GetStreamFlowControl().remote_window_delta();
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
246
|
+
// Endpoint Helpers
|
|
247
|
+
|
|
248
|
+
auto Http2ServerTransport::EndpointWrite(SliceBuffer&& output_buf) {
|
|
249
|
+
size_t output_buf_length = output_buf.Length();
|
|
250
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::EndpointWrite output_buf: "
|
|
251
|
+
<< output_buf_length;
|
|
252
|
+
|
|
253
|
+
transport_write_context_.GetWriteCycle().BeginWrite(output_buf_length);
|
|
254
|
+
return Map(
|
|
255
|
+
endpoint_.Write(std::forward<SliceBuffer>(output_buf),
|
|
256
|
+
TransportWriteContext::GetWriteArgs(settings_->peer())),
|
|
257
|
+
[this](absl::Status status) {
|
|
258
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
259
|
+
<< "Http2ServerTransport::EndpointWrite complete with status = "
|
|
260
|
+
<< status;
|
|
261
|
+
transport_write_context_.GetWriteCycle().EndWrite(status.ok());
|
|
262
|
+
return status;
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
auto Http2ServerTransport::SerializeAndWrite() {
|
|
267
|
+
return AssertResultType<absl::Status>(If(
|
|
268
|
+
transport_write_context_.GetWriteCycle().CanSerializeRegularFrames(),
|
|
269
|
+
[this]() mutable {
|
|
270
|
+
WriteCycle& write_cycle = transport_write_context_.GetWriteCycle();
|
|
271
|
+
const uint64_t frame_count = write_cycle.GetRegularFrameCount();
|
|
272
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
273
|
+
<< "Http2ServerTransport::SerializeAndWrite frame count: "
|
|
274
|
+
<< frame_count;
|
|
275
|
+
ztrace_collector_->Append(PromiseEndpointWriteTrace{frame_count});
|
|
276
|
+
return EndpointWrite(write_cycle.SerializeRegularFrames(
|
|
277
|
+
WriteCycle::SerializeStats{should_reset_ping_clock_}));
|
|
278
|
+
},
|
|
279
|
+
[]() { return absl::OkStatus(); }));
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
283
|
+
// Transport Read Path
|
|
284
|
+
|
|
285
|
+
Http2Status Http2ServerTransport::ProcessIncomingFrame(Http2DataFrame&& frame) {
|
|
286
|
+
// https://www.rfc-editor.org/rfc/rfc9113.html#name-data
|
|
287
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
288
|
+
<< "Http2ServerTransport::ProcessIncomingFrame(DataFrame) { stream_id="
|
|
289
|
+
<< frame.stream_id << ", end_stream:" << frame.end_stream
|
|
290
|
+
<< ", payload length=" << frame.payload.Length() << "}";
|
|
291
|
+
|
|
292
|
+
ping_manager_->ReceivedDataFrame();
|
|
293
|
+
|
|
294
|
+
RefCountedPtr<Stream> stream = LookupStream(frame.stream_id);
|
|
295
|
+
|
|
296
|
+
if (frame.payload.Length() > 0) {
|
|
297
|
+
// DATA frames with empty payload are legitimate frames. CHTTP2 and PH2 send
|
|
298
|
+
// empty DATA frames with END_Stream flag set to true.
|
|
299
|
+
ValueOrHttp2Status<chttp2::FlowControlAction> flow_control_action =
|
|
300
|
+
ProcessIncomingDataFrameFlowControl(
|
|
301
|
+
read_context_.GetCurrentFrameHeader(), flow_control_, stream.get());
|
|
302
|
+
if (!flow_control_action.IsOk()) {
|
|
303
|
+
return ValueOrHttp2Status<chttp2::FlowControlAction>::TakeStatus(
|
|
304
|
+
std::move(flow_control_action));
|
|
305
|
+
}
|
|
306
|
+
ActOnFlowControlAction(flow_control_action.value(), stream.get());
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
if (stream == nullptr) {
|
|
310
|
+
// TODO(tjagtap) : [PH2][P2] : Implement the correct behaviour later.
|
|
311
|
+
// RFC9113 : If a DATA frame is received whose stream is not in the "open"
|
|
312
|
+
// or "half-closed (local)" state, the recipient MUST respond with a stream
|
|
313
|
+
// error (Section 5.4.2) of type STREAM_CLOSED.
|
|
314
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
315
|
+
<< "Http2ServerTransport::ProcessIncomingFrame(DataFrame) { stream_id="
|
|
316
|
+
<< frame.stream_id << "} Lookup Failed";
|
|
317
|
+
return Http2Status::Ok();
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
// TODO(akshitpatel) : [PH2][P3] : We should add a check to reset stream if
|
|
321
|
+
// the stream state is kIdle as well.
|
|
322
|
+
|
|
323
|
+
Http2Status stream_status = stream->CanStreamReceiveDataFrames();
|
|
324
|
+
if (!stream_status.IsOk()) {
|
|
325
|
+
return stream_status;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
329
|
+
<< "Http2ServerTransport::ProcessIncomingFrame(DataFrame) "
|
|
330
|
+
"AppendNewDataFrame";
|
|
331
|
+
GrpcMessageAssembler& assembler = stream->GetGrpcMessageAssembler();
|
|
332
|
+
Http2Status status =
|
|
333
|
+
assembler.AppendNewDataFrame(frame.payload, frame.end_stream);
|
|
334
|
+
if (!status.IsOk()) {
|
|
335
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
336
|
+
<< "Http2ServerTransport::ProcessIncomingFrame(DataFrame) "
|
|
337
|
+
"AppendNewDataFrame Failed";
|
|
338
|
+
return status;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// Pass the messages up the stack if it is ready.
|
|
342
|
+
while (true) {
|
|
343
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
344
|
+
<< "Http2ServerTransport::ProcessIncomingFrame(DataFrame) "
|
|
345
|
+
"ExtractMessage";
|
|
346
|
+
ValueOrHttp2Status<MessageHandle> result = assembler.ExtractMessage();
|
|
347
|
+
if (!result.IsOk()) {
|
|
348
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
349
|
+
<< "Http2ServerTransport::ProcessIncomingFrame(DataFrame) "
|
|
350
|
+
"ExtractMessage Failed";
|
|
351
|
+
return ValueOrHttp2Status<MessageHandle>::TakeStatus(std::move(result));
|
|
352
|
+
}
|
|
353
|
+
MessageHandle message = TakeValue(std::move(result));
|
|
354
|
+
if (message != nullptr) {
|
|
355
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
356
|
+
<< "Http2ServerTransport::ProcessIncomingFrame(DataFrame) "
|
|
357
|
+
"SpawnPushMessage ";
|
|
358
|
+
stream->GetCallInitiator().SpawnPushMessage(std::move(message));
|
|
359
|
+
continue;
|
|
360
|
+
}
|
|
361
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
362
|
+
<< "Http2ServerTransport::ProcessIncomingFrame(DataFrame) While Break";
|
|
363
|
+
break;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
if (frame.end_stream) {
|
|
367
|
+
HandleStreamStateChange(*stream, stream->OnHalfCloseReceived());
|
|
368
|
+
}
|
|
369
|
+
return Http2Status::Ok();
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
template <typename T>
|
|
373
|
+
Http2Status Http2ServerTransport::ProcessIncomingMetadata(T&& frame) {
|
|
374
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
375
|
+
<< "Http2ServerTransport::ProcessIncomingMetadata { stream_id="
|
|
376
|
+
<< frame.stream_id << ", end_headers=" << frame.end_headers << " }";
|
|
377
|
+
ping_manager_->ReceivedDataFrame();
|
|
378
|
+
|
|
379
|
+
bool is_new_stream = false;
|
|
380
|
+
RefCountedPtr<Stream> stream = nullptr;
|
|
381
|
+
// State update MUST happen before processing the frame.
|
|
382
|
+
if (!read_context_.IsWaitingForContinuationFrame()) {
|
|
383
|
+
// This is a HEADERS frame.
|
|
384
|
+
stream = LookupStream(frame.stream_id);
|
|
385
|
+
is_new_stream = (stream == nullptr);
|
|
386
|
+
// TODO(tjagtap) : [PH2][P2] : Implement initial stream id checks for new
|
|
387
|
+
// streams.
|
|
388
|
+
last_incoming_stream_id_ = frame.stream_id;
|
|
389
|
+
} else {
|
|
390
|
+
// This is a CONTINUATION frame.
|
|
391
|
+
GRPC_DCHECK(read_context_.GetStreamId() == frame.stream_id);
|
|
392
|
+
GRPC_DCHECK(LookupStream(frame.stream_id) != nullptr);
|
|
393
|
+
is_new_stream = true;
|
|
394
|
+
}
|
|
395
|
+
read_context_.UpdateState(frame, /*is_existing_stream=*/!is_new_stream);
|
|
396
|
+
|
|
397
|
+
if (is_new_stream) {
|
|
398
|
+
// TODO(tjagtap) : [PH2][P3] : Implement this.
|
|
399
|
+
// RFC9113 : The identifier of a newly established stream MUST be
|
|
400
|
+
// numerically greater than all streams that the initiating endpoint has
|
|
401
|
+
// opened or reserved. This governs streams that are opened using a HEADERS
|
|
402
|
+
// frame and streams that are reserved using PUSH_PROMISE. An endpoint that
|
|
403
|
+
// receives an unexpected stream identifier MUST respond with a connection
|
|
404
|
+
// error (Section 5.4.1) of type PROTOCOL_ERROR.
|
|
405
|
+
|
|
406
|
+
if (goaway_manager_.IsFinalGracefulGoawayScheduledOrSent()) {
|
|
407
|
+
return read_context_.ParseAndDiscardHeaders(
|
|
408
|
+
std::move(frame.payload), frame.end_headers, Http2Status::Ok(),
|
|
409
|
+
settings_->acked().max_header_list_size());
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
Http2Status append_result =
|
|
413
|
+
read_context_.header_assembler().AppendFrame(frame);
|
|
414
|
+
if (!append_result.IsOk()) {
|
|
415
|
+
// Frame payload is not consumed if AppendFrame returns a non-OK
|
|
416
|
+
// status. We need to process it to keep our in consistent state.
|
|
417
|
+
return read_context_.ParseAndDiscardHeaders(
|
|
418
|
+
std::move(frame.payload), frame.end_headers, std::move(append_result),
|
|
419
|
+
settings_->acked().max_header_list_size());
|
|
420
|
+
}
|
|
421
|
+
Http2Status status = ProcessMetadata();
|
|
422
|
+
if (!status.IsOk()) {
|
|
423
|
+
// Frame payload has been moved to the HeaderAssembler. So calling
|
|
424
|
+
// ParseAndDiscardHeaders with an empty buffer.
|
|
425
|
+
return read_context_.ParseAndDiscardHeaders(
|
|
426
|
+
SliceBuffer(), frame.end_headers, std::move(status),
|
|
427
|
+
settings_->acked().max_header_list_size());
|
|
428
|
+
}
|
|
429
|
+
} else {
|
|
430
|
+
// Stream already exists.
|
|
431
|
+
// TODO(tjagtap) : [PH2][P1] : Implement/Verify this
|
|
432
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
433
|
+
<< "Http2ServerTransport::ProcessIncomingMetadata { stream_id="
|
|
434
|
+
<< frame.stream_id << "} Stream already exists.";
|
|
435
|
+
Http2Status validation_status =
|
|
436
|
+
ValidateMetadataFrameState(frame, *stream, read_context_,
|
|
437
|
+
settings_->acked().max_header_list_size());
|
|
438
|
+
if (!validation_status.IsOk()) {
|
|
439
|
+
return validation_status;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
// Frame payload has either been processed or moved to the HeaderAssembler.
|
|
443
|
+
return Http2Status::Ok();
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
Http2Status Http2ServerTransport::ProcessIncomingFrame(
|
|
447
|
+
Http2HeaderFrame&& frame) {
|
|
448
|
+
// https://www.rfc-editor.org/rfc/rfc9113.html#name-headers
|
|
449
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
450
|
+
<< "Http2ServerTransport::ProcessIncomingFrame(HeaderFrame) end_stream="
|
|
451
|
+
<< frame.end_stream;
|
|
452
|
+
return ProcessIncomingMetadata(std::forward<Http2HeaderFrame>(frame));
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
Http2Status Http2ServerTransport::ProcessIncomingFrame(
|
|
456
|
+
Http2RstStreamFrame&& frame) {
|
|
457
|
+
// https://www.rfc-editor.org/rfc/rfc9113.html#name-rst_stream
|
|
458
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
459
|
+
<< "Http2ServerTransport::ProcessIncomingFrame(ResetStreamFrame) { "
|
|
460
|
+
"stream_id="
|
|
461
|
+
<< frame.stream_id << ", error_code=" << frame.error_code << " }";
|
|
462
|
+
read_context_.OnResetFrameReceived();
|
|
463
|
+
|
|
464
|
+
Http2ErrorCode error_code = FrameErrorCodeToHttp2ErrorCode(frame.error_code);
|
|
465
|
+
absl::Status status = absl::Status(ErrorCodeToAbslStatusCode(error_code),
|
|
466
|
+
"Reset stream frame received.");
|
|
467
|
+
RefCountedPtr<Stream> stream = LookupStream(frame.stream_id);
|
|
468
|
+
if (stream != nullptr) {
|
|
469
|
+
if (status.ok()) {
|
|
470
|
+
status =
|
|
471
|
+
absl::UnavailableError("RST_STREAM frame received with no error.");
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
HandleStreamStateChange(*stream,
|
|
475
|
+
stream->OnResetReceived(std::move(status)));
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// In case of stream error, we do not want the Read Loop to be broken. Hence
|
|
479
|
+
// returning an ok status.
|
|
480
|
+
return Http2Status::Ok();
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
Http2Status Http2ServerTransport::ProcessIncomingFrame(
|
|
484
|
+
Http2SettingsFrame&& frame) {
|
|
485
|
+
// https://www.rfc-editor.org/rfc/rfc9113.html#name-settings
|
|
486
|
+
|
|
487
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
488
|
+
<< "Http2ServerTransport::ProcessIncomingFrame(SettingsFrame) { ack="
|
|
489
|
+
<< frame.ack << ", settings length=" << frame.settings.size() << "}";
|
|
490
|
+
|
|
491
|
+
if (!frame.ack) {
|
|
492
|
+
read_context_.OnSettingsFrameReceived();
|
|
493
|
+
Http2Status s = settings_->BufferPeerSettings(std::move(frame.settings));
|
|
494
|
+
if (!s.IsOk()) {
|
|
495
|
+
return s;
|
|
496
|
+
}
|
|
497
|
+
absl::Status trigger_write_status = TriggerWriteCycle();
|
|
498
|
+
if (!trigger_write_status.ok()) {
|
|
499
|
+
return ToHttpOkOrConnError(trigger_write_status);
|
|
500
|
+
}
|
|
501
|
+
if (GPR_UNLIKELY(!settings_->IsFirstPeerSettingsApplied())) {
|
|
502
|
+
// Apply the first settings before we read any other frames.
|
|
503
|
+
read_context_.SetPauseReadLoop();
|
|
504
|
+
}
|
|
505
|
+
} else {
|
|
506
|
+
Http2Status status = settings_->OnSettingsAckReceived();
|
|
507
|
+
if (!status.IsOk()) {
|
|
508
|
+
return status;
|
|
509
|
+
}
|
|
510
|
+
read_context_.SetMaxHeaderTableSize(settings_->acked().header_table_size());
|
|
511
|
+
read_context_.header_assembler().MaybeSetAllowTrueBinaryMetadataAcked(
|
|
512
|
+
settings_->acked().allow_true_binary_metadata());
|
|
513
|
+
ActOnFlowControlAction(flow_control_.SetAckedInitialWindow(
|
|
514
|
+
settings_->acked().initial_window_size()),
|
|
515
|
+
/*stream=*/nullptr);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
return Http2Status::Ok();
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
Http2Status Http2ServerTransport::ProcessIncomingFrame(Http2PingFrame&& frame) {
|
|
522
|
+
// https://www.rfc-editor.org/rfc/rfc9113.html#name-ping
|
|
523
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
524
|
+
<< "Http2ServerTransport::ProcessIncomingFrame(PingFrame) { ack="
|
|
525
|
+
<< frame.ack << ", opaque=" << frame.opaque << " }";
|
|
526
|
+
if (frame.ack) {
|
|
527
|
+
return ToHttpOkOrConnError(AckPing(frame.opaque));
|
|
528
|
+
} else {
|
|
529
|
+
read_context_.OnPingFrameReceived();
|
|
530
|
+
if (test_only_ack_pings_) {
|
|
531
|
+
ping_manager_->AddPendingPingAck(frame.opaque);
|
|
532
|
+
return ToHttpOkOrConnError(TriggerWriteCycle());
|
|
533
|
+
} else {
|
|
534
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
535
|
+
<< "Http2ServerTransport::ProcessIncomingFrame(PingFrame) "
|
|
536
|
+
"test_only_ack_pings_ is false. Ignoring the ping request.";
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
return Http2Status::Ok();
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
Http2Status Http2ServerTransport::ProcessIncomingFrame(
|
|
543
|
+
Http2GoawayFrame&& frame) {
|
|
544
|
+
// https://www.rfc-editor.org/rfc/rfc9113.html#name-goaway
|
|
545
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
546
|
+
<< "Http2ServerTransport::ProcessIncomingFrame(GoawayFrame) { "
|
|
547
|
+
"last_stream_id="
|
|
548
|
+
<< frame.last_stream_id << ", error_code=" << frame.error_code << "}";
|
|
549
|
+
LOG_IF(ERROR,
|
|
550
|
+
frame.error_code != static_cast<uint32_t>(Http2ErrorCode::kNoError))
|
|
551
|
+
<< "Received GOAWAY frame with error code: " << frame.error_code;
|
|
552
|
+
|
|
553
|
+
// uint32_t last_stream_id = 0;
|
|
554
|
+
// absl::Status status(ErrorCodeToAbslStatusCode(
|
|
555
|
+
// FrameErrorCodeToHttp2ErrorCode(frame.error_code)),
|
|
556
|
+
// frame.debug_data.empty()
|
|
557
|
+
// ? absl::string_view("GOAWAY received")
|
|
558
|
+
// : frame.debug_data.as_string_view());
|
|
559
|
+
// if (GoawayManager::IsGracefulGoaway(frame)) {
|
|
560
|
+
// const uint32_t next_stream_id = PeekNextStreamId();
|
|
561
|
+
// last_stream_id = (next_stream_id > 1) ? next_stream_id - 2 : 0;
|
|
562
|
+
// } else {
|
|
563
|
+
// last_stream_id = frame.last_stream_id;
|
|
564
|
+
// }
|
|
565
|
+
// SetMaxAllowedStreamId(last_stream_id);
|
|
566
|
+
|
|
567
|
+
// bool close_transport = false;
|
|
568
|
+
// {
|
|
569
|
+
// MutexLock lock(&transport_mutex_);
|
|
570
|
+
// if (CanCloseTransportLocked()) {
|
|
571
|
+
// close_transport = true;
|
|
572
|
+
// GRPC_HTTP2_SERVER_DLOG <<
|
|
573
|
+
// "Http2ServerTransport::ProcessIncomingFrame("
|
|
574
|
+
// "GoawayFrame) "
|
|
575
|
+
// "stream_list_ is empty";
|
|
576
|
+
// }
|
|
577
|
+
// }
|
|
578
|
+
|
|
579
|
+
// StateWatcher::DisconnectInfo disconnect_info;
|
|
580
|
+
// disconnect_info.reason = Transport::StateWatcher::kGoaway;
|
|
581
|
+
// disconnect_info.http2_error_code =
|
|
582
|
+
// static_cast<Http2ErrorCode>(frame.error_code);
|
|
583
|
+
|
|
584
|
+
// // Throttle keepalive time if the server sends a GOAWAY with error code
|
|
585
|
+
// // ENHANCE_YOUR_CALM and debug data equal to "too_many_pings". This
|
|
586
|
+
// will
|
|
587
|
+
// // apply to any new transport created on by any subchannel of this
|
|
588
|
+
// channel. if (GPR_UNLIKELY(frame.error_code == static_cast<uint32_t>(
|
|
589
|
+
// Http2ErrorCode::kEnhanceYourCalm)
|
|
590
|
+
// &&
|
|
591
|
+
// frame.debug_data == "too_many_pings")) {
|
|
592
|
+
// LOG(ERROR) << ": Received a GOAWAY with error code ENHANCE_YOUR_CALM
|
|
593
|
+
// and
|
|
594
|
+
// "
|
|
595
|
+
// "debug data equal to \"too_many_pings\". Current
|
|
596
|
+
// keepalive " "time (before throttling): "
|
|
597
|
+
// << keepalive_time_.ToString();
|
|
598
|
+
// constexpr int max_keepalive_time_millis =
|
|
599
|
+
// INT_MAX / KEEPALIVE_TIME_BACKOFF_MULTIPLIER;
|
|
600
|
+
// uint64_t throttled_keepalive_time =
|
|
601
|
+
// keepalive_time_.millis() > max_keepalive_time_millis
|
|
602
|
+
// ? INT_MAX
|
|
603
|
+
// : keepalive_time_.millis() *
|
|
604
|
+
// KEEPALIVE_TIME_BACKOFF_MULTIPLIER;
|
|
605
|
+
// if (!IsSubchannelConnectionScalingEnabled()) {
|
|
606
|
+
// status.SetPayload(kKeepaliveThrottlingKey,
|
|
607
|
+
// absl::Cord(std::to_string(throttled_keepalive_time)));
|
|
608
|
+
// }
|
|
609
|
+
// disconnect_info.keepalive_time =
|
|
610
|
+
// Duration::Milliseconds(throttled_keepalive_time);
|
|
611
|
+
// }
|
|
612
|
+
|
|
613
|
+
// if (close_transport) {
|
|
614
|
+
// // TODO(akshitpatel) : [PH2][P3] : Ideally the error here should be
|
|
615
|
+
// // kNoError. However, Http2Status does not support kNoError. We
|
|
616
|
+
// should
|
|
617
|
+
// // revisit this and update the error code.
|
|
618
|
+
// MaybeSpawnCloseTransport(Http2Status::Http2ConnectionError(
|
|
619
|
+
// FrameErrorCodeToHttp2ErrorCode((
|
|
620
|
+
// frame.error_code ==
|
|
621
|
+
// Http2ErrorCodeToFrameErrorCode(Http2ErrorCode::kNoError)
|
|
622
|
+
// ?
|
|
623
|
+
// Http2ErrorCodeToFrameErrorCode(Http2ErrorCode::kInternalError)
|
|
624
|
+
// : frame.error_code)),
|
|
625
|
+
// frame.debug_data.empty()
|
|
626
|
+
// ? std::string("GOAWAY received")
|
|
627
|
+
// : std::string(frame.debug_data.as_string_view())));
|
|
628
|
+
// }
|
|
629
|
+
|
|
630
|
+
// // lie: use transient failure from the transport to indicate goaway has
|
|
631
|
+
// been
|
|
632
|
+
// // received.
|
|
633
|
+
// ReportDisconnection(status, disconnect_info, "got_goaway");
|
|
634
|
+
return Http2Status::Ok();
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
Http2Status Http2ServerTransport::ProcessIncomingFrame(
|
|
638
|
+
Http2WindowUpdateFrame&& frame) {
|
|
639
|
+
// https://www.rfc-editor.org/rfc/rfc9113.html#name-window_update
|
|
640
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
641
|
+
<< "Http2ServerTransport::ProcessIncomingFrame(WindowUpdateFrame) { "
|
|
642
|
+
" stream_id="
|
|
643
|
+
<< frame.stream_id << ", increment=" << frame.increment << "}";
|
|
644
|
+
|
|
645
|
+
RefCountedPtr<Stream> stream = nullptr;
|
|
646
|
+
if (frame.stream_id != 0) {
|
|
647
|
+
stream = LookupStream(frame.stream_id);
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
const bool should_trigger_write = ProcessIncomingWindowUpdateFrameFlowControl(
|
|
651
|
+
frame, flow_control_, stream.get());
|
|
652
|
+
|
|
653
|
+
if (should_trigger_write) {
|
|
654
|
+
return ToHttpOkOrConnError(TriggerWriteCycle());
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
if (stream != nullptr) {
|
|
658
|
+
StreamWritabilityUpdate update =
|
|
659
|
+
stream->UpdateStreamWritability(GetStreamFlowControlTokens(
|
|
660
|
+
stream->GetStreamFlowControl(), settings_->peer()));
|
|
661
|
+
if (update.became_writable) {
|
|
662
|
+
absl::Status status = writable_stream_list_.EnqueueWrapper(
|
|
663
|
+
stream, update.priority, AreTransportFlowControlTokensAvailable());
|
|
664
|
+
if (!status.ok()) {
|
|
665
|
+
return ToHttpOkOrConnError(status);
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
return Http2Status::Ok();
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
Http2Status Http2ServerTransport::ProcessIncomingFrame(
|
|
673
|
+
Http2ContinuationFrame&& frame) {
|
|
674
|
+
// https://www.rfc-editor.org/rfc/rfc9113.html#name-continuation
|
|
675
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
676
|
+
<< "Http2ServerTransport::ProcessIncomingFrame(ContinuationFrame)";
|
|
677
|
+
return ProcessIncomingMetadata(std::forward<Http2ContinuationFrame>(frame));
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
Http2Status Http2ServerTransport::ProcessIncomingFrame(
|
|
681
|
+
Http2SecurityFrame&& frame) {
|
|
682
|
+
if (settings_->IsSecurityFrameExpected()) {
|
|
683
|
+
security_frame_handler_->ProcessPayload(std::move(frame.payload));
|
|
684
|
+
}
|
|
685
|
+
return Http2Status::Ok();
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
Http2Status Http2ServerTransport::ProcessIncomingFrame(
|
|
689
|
+
GRPC_UNUSED Http2UnknownFrame&& frame) {
|
|
690
|
+
// RFC9113: Implementations MUST ignore and discard frames of
|
|
691
|
+
// unknown types.
|
|
692
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
693
|
+
<< "Http2ServerTransport::ProcessIncomingFrame(UnknownFrame) ";
|
|
694
|
+
return Http2Status::Ok();
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
Http2Status Http2ServerTransport::ProcessIncomingFrame(
|
|
698
|
+
GRPC_UNUSED Http2EmptyFrame&& frame) {
|
|
699
|
+
LOG(DFATAL) << "ParseFramePayload should never return a Http2EmptyFrame";
|
|
700
|
+
return Http2Status::Ok();
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
Http2Status Http2ServerTransport::ProcessMetadata() {
|
|
704
|
+
HeaderAssembler& assembler = read_context_.header_assembler();
|
|
705
|
+
// CallInitiator& call = stream->GetCallInitiator();
|
|
706
|
+
|
|
707
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::ProcessMetadata";
|
|
708
|
+
if (assembler.IsReady()) {
|
|
709
|
+
ValueOrHttp2Status<ServerMetadataHandle> read_result =
|
|
710
|
+
assembler.ReadMetadata(read_context_.parser(),
|
|
711
|
+
!read_context_.HeaderHasEndStream(),
|
|
712
|
+
/*max_header_list_size_soft_limit=*/
|
|
713
|
+
read_context_.soft_limit(),
|
|
714
|
+
/*max_header_list_size_hard_limit=*/
|
|
715
|
+
settings_->acked().max_header_list_size());
|
|
716
|
+
if (read_result.IsOk()) {
|
|
717
|
+
ServerMetadataHandle metadata = TakeValue(std::move(read_result));
|
|
718
|
+
// TODO(tjagtap): [PH2][P0] : Might be worth differentiating between
|
|
719
|
+
// initial and trailing metadata based on the number of header frames
|
|
720
|
+
// received.
|
|
721
|
+
if (read_context_.HeaderHasEndStream()) {
|
|
722
|
+
// TODO(akshitpatel) [PH2][P1] : Implement receiving trailing metadata.
|
|
723
|
+
// Details:
|
|
724
|
+
// - Standard gRPC clients do not send trailers (only EOS).
|
|
725
|
+
// - If received (HEADERS with END_STREAM), mark stream as half-closed
|
|
726
|
+
// remote.
|
|
727
|
+
// - Upper layers discard client trailers, so we are fine with not
|
|
728
|
+
// propagating them.
|
|
729
|
+
//
|
|
730
|
+
// With these assumptions, the flow will look like this:
|
|
731
|
+
// - If the client sends trailing metadata with an OK status, we will
|
|
732
|
+
// mark the stream as half-closed remote and do nothing else.
|
|
733
|
+
// - If the client sends trailing metadata with a non-OK status, this
|
|
734
|
+
// case needs to be handled.
|
|
735
|
+
// TODO(akshitpatel) : [PH2][P0] : Verify this.
|
|
736
|
+
RefCountedPtr<Stream> stream =
|
|
737
|
+
LookupStream(read_context_.GetStreamId());
|
|
738
|
+
HandleStreamStateChange(
|
|
739
|
+
*stream, stream->OnTrailingMetadataReceived(std::move(metadata)));
|
|
740
|
+
} else {
|
|
741
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::ProcessMetadata "
|
|
742
|
+
"SpawnPushServerInitialMetadata";
|
|
743
|
+
metadata->Set(PeerString(), read_context_.peer_string());
|
|
744
|
+
return IncomingStream(std::move(metadata), read_context_.GetStreamId());
|
|
745
|
+
}
|
|
746
|
+
return Http2Status::Ok();
|
|
747
|
+
}
|
|
748
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::ProcessMetadata Failed";
|
|
749
|
+
return ValueOrHttp2Status<Arena::PoolPtr<grpc_metadata_batch>>::TakeStatus(
|
|
750
|
+
std::move(read_result));
|
|
751
|
+
}
|
|
752
|
+
return Http2Status::Ok();
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
auto Http2ServerTransport::ReadAndProcessOneFrame() {
|
|
756
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
757
|
+
<< "Http2ServerTransport::ReadAndProcessOneFrame Factory";
|
|
758
|
+
return AssertResultType<absl::Status>(TrySeq(
|
|
759
|
+
// Fetch the first kFrameHeaderSize bytes of the Frame, these contain
|
|
760
|
+
// the frame header.
|
|
761
|
+
EndpointReadSlice(kFrameHeaderSize),
|
|
762
|
+
// Parse the frame header.
|
|
763
|
+
[this](Slice header_bytes) {
|
|
764
|
+
Http2FrameHeader header = Http2FrameHeader::Parse(header_bytes.begin());
|
|
765
|
+
// Validate the incoming frame as per the current state of the transport
|
|
766
|
+
Http2Status status = read_context_.ValidateHeader(
|
|
767
|
+
/*max_frame_size_setting=*/settings_->acked().max_frame_size(),
|
|
768
|
+
/*current_frame_header=*/header,
|
|
769
|
+
// TODO(tjagtap) : [PH2][P0] : Fix
|
|
770
|
+
/*last_stream_id=*//*GetLastStreamId()*/
|
|
771
|
+
std::numeric_limits<uint32_t>::max(),
|
|
772
|
+
/*is_first_settings_processed=*/
|
|
773
|
+
settings_->IsFirstPeerSettingsApplied());
|
|
774
|
+
|
|
775
|
+
if (GPR_UNLIKELY(!status.IsOk())) {
|
|
776
|
+
GRPC_DCHECK(status.GetType() ==
|
|
777
|
+
Http2Status::Http2ErrorType::kConnectionError);
|
|
778
|
+
return HandleError(/*stream=*/nullptr, std::move(status));
|
|
779
|
+
}
|
|
780
|
+
read_context_.SetCurrentFrameHeader(header);
|
|
781
|
+
return absl::OkStatus();
|
|
782
|
+
},
|
|
783
|
+
// Read the payload of the frame.
|
|
784
|
+
[this]() {
|
|
785
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
786
|
+
<< "Http2ServerTransport::ReadAndProcessOneFrame Read Frame ";
|
|
787
|
+
return AssertResultType<absl::Status>(
|
|
788
|
+
Map(EndpointRead(read_context_.GetCurrentFrameHeader().length),
|
|
789
|
+
[this](absl::StatusOr<SliceBuffer>&& payload) {
|
|
790
|
+
if (GPR_UNLIKELY(!payload.ok())) {
|
|
791
|
+
return payload.status();
|
|
792
|
+
}
|
|
793
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
794
|
+
<< "Http2ServerTransport::ReadAndProcessOneFrame "
|
|
795
|
+
"ParseFramePayload payload length: "
|
|
796
|
+
<< payload.value().Length();
|
|
797
|
+
ValueOrHttp2Status<Http2Frame> frame =
|
|
798
|
+
ParseFramePayload(read_context_.GetCurrentFrameHeader(),
|
|
799
|
+
TakeValue(std::move(payload)));
|
|
800
|
+
if (GPR_UNLIKELY(!frame.IsOk())) {
|
|
801
|
+
return HandleError(
|
|
802
|
+
LookupStream(
|
|
803
|
+
read_context_.GetCurrentFrameHeader().stream_id),
|
|
804
|
+
ValueOrHttp2Status<Http2Frame>::TakeStatus(
|
|
805
|
+
std::move(frame)));
|
|
806
|
+
}
|
|
807
|
+
Http2Status status =
|
|
808
|
+
ProcessOneIncomingFrame(TakeValue(std::move(frame)));
|
|
809
|
+
if (GPR_UNLIKELY(!status.IsOk())) {
|
|
810
|
+
return HandleError(
|
|
811
|
+
LookupStream(
|
|
812
|
+
read_context_.GetCurrentFrameHeader().stream_id),
|
|
813
|
+
std::move(status));
|
|
814
|
+
}
|
|
815
|
+
return absl::OkStatus();
|
|
816
|
+
}));
|
|
817
|
+
},
|
|
818
|
+
[this]() -> Poll<absl::Status> {
|
|
819
|
+
Poll<absl::Status> poll_result = read_context_.MaybePauseReadLoop();
|
|
820
|
+
if (poll_result.pending()) {
|
|
821
|
+
TriggerWriteCycleOrHandleError();
|
|
822
|
+
}
|
|
823
|
+
return poll_result;
|
|
824
|
+
}));
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
auto Http2ServerTransport::ReadLoop() {
|
|
828
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::ReadLoop Factory";
|
|
829
|
+
return AssertResultType<absl::Status>(Loop([this]() {
|
|
830
|
+
return TrySeq(ReadAndProcessOneFrame(), []() -> LoopCtl<absl::Status> {
|
|
831
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::ReadLoop Continue";
|
|
832
|
+
return Continue();
|
|
833
|
+
});
|
|
834
|
+
}));
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
838
|
+
// Transport Write Path
|
|
839
|
+
|
|
840
|
+
absl::Status Http2ServerTransport::PrepareControlFrames() {
|
|
841
|
+
FrameSender frame_sender =
|
|
842
|
+
transport_write_context_.GetWriteCycle().GetFrameSender();
|
|
843
|
+
if (transport_write_context_.IsFirstWrite()) {
|
|
844
|
+
// Send the first settings frame.
|
|
845
|
+
settings_->MaybeGetSettingsAndSettingsAckFrames(flow_control_,
|
|
846
|
+
frame_sender);
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
// Order of Control Frames is important.
|
|
850
|
+
// 1. GOAWAY - This is first because if this is the final GoAway, then we may
|
|
851
|
+
// not need to send anything else to the peer.
|
|
852
|
+
// 2. SETTINGS and SETTINGS ACK
|
|
853
|
+
// 3. PING and PING acks.
|
|
854
|
+
// 4. WINDOW_UPDATE
|
|
855
|
+
// 5. Custom gRPC security frame
|
|
856
|
+
|
|
857
|
+
goaway_manager_.MaybeGetSerializedGoawayFrame(frame_sender);
|
|
858
|
+
ApplySettingsResult apply_settings_result;
|
|
859
|
+
|
|
860
|
+
const uint32_t old_initial_window_size =
|
|
861
|
+
settings_->peer().initial_window_size();
|
|
862
|
+
const http2::Http2ErrorCode apply_status =
|
|
863
|
+
settings_->MaybeReportAndApplyBufferedPeerSettings(event_engine_.get(),
|
|
864
|
+
apply_settings_result);
|
|
865
|
+
|
|
866
|
+
if (apply_status == http2::Http2ErrorCode::kNoError) {
|
|
867
|
+
const uint32_t new_initial_window_size =
|
|
868
|
+
settings_->peer().initial_window_size();
|
|
869
|
+
if (new_initial_window_size > old_initial_window_size) {
|
|
870
|
+
// TODO(akshitpatel) [PH2][P5] : Currently, if calling
|
|
871
|
+
// UpdateAllStreamsWritability() makes one or more streams writable. Once
|
|
872
|
+
// a stream is writable, it is enqueued to the writable stream list.
|
|
873
|
+
// However, these streams are not written out until the next write cycle.
|
|
874
|
+
// Might be worth considering to write out these streams immediately.
|
|
875
|
+
settings_->IncrementInitialWindowSizeIncreaseCount();
|
|
876
|
+
absl::Status status = UpdateAllStreamsWritability();
|
|
877
|
+
if (GPR_UNLIKELY(!status.ok())) {
|
|
878
|
+
return status;
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
if (apply_settings_result.should_spawn_security_frame_loop) {
|
|
884
|
+
const SecurityFrameHandler::EndpointExtensionState state =
|
|
885
|
+
security_frame_handler_->Initialize(event_engine_);
|
|
886
|
+
if (state.is_set) {
|
|
887
|
+
SpawnInfallibleTransportParty("SecurityFrameLoop",
|
|
888
|
+
UntilTransportClosed(SecurityFrameLoop()));
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
if (!goaway_manager_.IsImmediateGoAway() &&
|
|
893
|
+
apply_status == http2::Http2ErrorCode::kNoError) {
|
|
894
|
+
EnforceLatestIncomingSettings();
|
|
895
|
+
settings_->MaybeGetSettingsAndSettingsAckFrames(flow_control_,
|
|
896
|
+
frame_sender);
|
|
897
|
+
MaybeSpawnDelayedPing(ping_manager_->MaybeGetSerializedPingFrames(
|
|
898
|
+
frame_sender, NextAllowedPingInterval()));
|
|
899
|
+
MaybeGetWindowUpdateFrames(frame_sender);
|
|
900
|
+
security_frame_handler_->MaybeAppendSecurityFrame(frame_sender);
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
if (apply_status != http2::Http2ErrorCode::kNoError) {
|
|
904
|
+
return HandleError(/*stream=*/nullptr,
|
|
905
|
+
Http2Status::Http2ConnectionError(
|
|
906
|
+
apply_status, "Failed to apply incoming settings"));
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
return absl::OkStatus();
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
auto Http2ServerTransport::MaybeWriteUrgentFrames() {
|
|
913
|
+
return AssertResultType<absl::Status>(If(
|
|
914
|
+
transport_write_context_.GetWriteCycle().CanSerializeUrgentFrames(),
|
|
915
|
+
[this]() mutable {
|
|
916
|
+
WriteCycle& write_cycle = transport_write_context_.GetWriteCycle();
|
|
917
|
+
const uint64_t buffer_length = write_cycle.GetUrgentFrameCount();
|
|
918
|
+
ztrace_collector_->Append(PromiseEndpointWriteTrace{buffer_length});
|
|
919
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
920
|
+
<< "Http2ServerTransport::MaybeWriteUrgentFrames frame count: "
|
|
921
|
+
<< buffer_length;
|
|
922
|
+
return EndpointWrite(write_cycle.SerializeUrgentFrames(
|
|
923
|
+
WriteCycle::SerializeStats{should_reset_ping_clock_}));
|
|
924
|
+
},
|
|
925
|
+
[]() { return absl::OkStatus(); }));
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
void Http2ServerTransport::NotifyFramesWriteDone() {
|
|
929
|
+
// Notify Control modules that we have sent the frames.
|
|
930
|
+
// All notifications are expected to be synchronous.
|
|
931
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::NotifyFramesWriteDone";
|
|
932
|
+
read_context_.ResumeReadLoopIfPaused();
|
|
933
|
+
MaybeSpawnPingTimeout(ping_manager_->NotifyPingSent());
|
|
934
|
+
goaway_manager_.NotifyGoawaySent();
|
|
935
|
+
MaybeSpawnWaitForSettingsTimeout();
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
void Http2ServerTransport::NotifyUrgentFramesWriteDone() {}
|
|
939
|
+
|
|
940
|
+
absl::Status Http2ServerTransport::DequeueStreamFrames(
|
|
941
|
+
RefCountedPtr<Stream> stream, WriteCycle& write_cycle) {
|
|
942
|
+
// write_bytes_remaining_ is passed as an upper bound on the max
|
|
943
|
+
// number of tokens that can be dequeued to prevent dequeuing huge
|
|
944
|
+
// data frames when write_bytes_remaining_ is very low. As the
|
|
945
|
+
// available transport tokens can only range from 0 to 2^31 - 1,
|
|
946
|
+
// we are clamping the write_bytes_remaining_ to that range.
|
|
947
|
+
FrameSender frame_sender = write_cycle.GetFrameSender();
|
|
948
|
+
const uint32_t tokens = GetMaxPermittedDequeue(
|
|
949
|
+
flow_control_, stream->GetStreamFlowControl(),
|
|
950
|
+
write_cycle.GetWriteBytesRemaining(), settings_->peer());
|
|
951
|
+
const uint32_t stream_flow_control_tokens =
|
|
952
|
+
static_cast<uint32_t>(GetStreamFlowControlTokens(
|
|
953
|
+
stream->GetStreamFlowControl(), settings_->peer()));
|
|
954
|
+
stream->GetStreamFlowControl().ReportIfStalled(
|
|
955
|
+
/*is_client=*/kIsClient, stream->GetStreamId(), settings_->peer());
|
|
956
|
+
StreamDataQueue<ClientMetadataHandle>::DequeueResult result =
|
|
957
|
+
stream->DequeueFrames(tokens, stream_flow_control_tokens,
|
|
958
|
+
settings_->peer().max_frame_size(), encoder_,
|
|
959
|
+
frame_sender);
|
|
960
|
+
ProcessOutgoingDataFrameFlowControl(stream->GetStreamFlowControl(),
|
|
961
|
+
result.flow_control_tokens_consumed);
|
|
962
|
+
if (result.is_writable) {
|
|
963
|
+
// Stream is still writable. Enqueue it back to the writable
|
|
964
|
+
// stream list.
|
|
965
|
+
absl::Status status = writable_stream_list_.EnqueueWrapper(
|
|
966
|
+
stream, result.priority, AreTransportFlowControlTokensAvailable());
|
|
967
|
+
|
|
968
|
+
if (GPR_UNLIKELY(!status.ok())) {
|
|
969
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
970
|
+
<< "Http2ServerTransport::DequeueStreamFrames Failed to "
|
|
971
|
+
"enqueue stream "
|
|
972
|
+
<< stream->GetStreamId() << " with status: " << status;
|
|
973
|
+
// Close transport if we fail to enqueue stream.
|
|
974
|
+
return HandleError(/*stream=*/nullptr, ToHttpOkOrConnError(status));
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
if (result.IsInitialMetadataDequeued()) {
|
|
979
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
980
|
+
<< "Http2ServerTransport::DequeueStreamFrames InitialMetadataDequeued "
|
|
981
|
+
"stream_id = "
|
|
982
|
+
<< stream->GetStreamId();
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
if (result.IsTrailingMetadataDequeued()) {
|
|
986
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::DequeueStreamFrames "
|
|
987
|
+
"TrailingMetadataDequeued stream_id = "
|
|
988
|
+
<< stream->GetStreamId();
|
|
989
|
+
// Stream is not marked closed here as TrailingMetadata is always followed
|
|
990
|
+
// by RST_STREAM and we close the stream when we dequeue the RST_STREAM.
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
if (result.IsResetStreamDequeued()) {
|
|
994
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
995
|
+
<< "Http2ServerTransport::DequeueStreamFrames ResetStreamDequeued "
|
|
996
|
+
"stream_id = "
|
|
997
|
+
<< stream->GetStreamId();
|
|
998
|
+
// As Trailing metadata is already read from CallInitiator, no need to send
|
|
999
|
+
// a status to the application.
|
|
1000
|
+
HandleStreamStateChange(*stream, stream->OnResetSent());
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::DequeueStreamFrames "
|
|
1004
|
+
"After dequeue: "
|
|
1005
|
+
<< write_cycle.DebugString()
|
|
1006
|
+
<< " stream_id = " << stream->GetStreamId()
|
|
1007
|
+
<< " is_writable = " << result.is_writable
|
|
1008
|
+
<< " stream_priority = "
|
|
1009
|
+
<< static_cast<uint8_t>(result.priority);
|
|
1010
|
+
return absl::OkStatus();
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
// This MultiplexerLoop promise is responsible for Multiplexing multiple gRPC
|
|
1014
|
+
// Requests (HTTP2 Streams) and writing them into one common endpoint.
|
|
1015
|
+
auto Http2ServerTransport::MultiplexerLoop() {
|
|
1016
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::MultiplexerLoop Factory";
|
|
1017
|
+
return AssertResultType<absl::Status>(Loop([this]() {
|
|
1018
|
+
return TrySeq(
|
|
1019
|
+
Map(writable_stream_list_.WaitForReady(
|
|
1020
|
+
AreTransportFlowControlTokensAvailable()),
|
|
1021
|
+
[this](absl::StatusOr<Empty> status) -> absl::Status {
|
|
1022
|
+
if (GPR_UNLIKELY(!status.ok())) {
|
|
1023
|
+
return status.status();
|
|
1024
|
+
}
|
|
1025
|
+
transport_write_context_.StartWriteCycle();
|
|
1026
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::MultiplexerLoop "
|
|
1027
|
+
"Start Iteration: "
|
|
1028
|
+
<< transport_write_context_.DebugString();
|
|
1029
|
+
return PrepareControlFrames();
|
|
1030
|
+
}),
|
|
1031
|
+
[this] {
|
|
1032
|
+
return Map(MaybeWriteUrgentFrames(), [this](absl::Status status) {
|
|
1033
|
+
if (GPR_UNLIKELY(!status.ok())) {
|
|
1034
|
+
return status;
|
|
1035
|
+
}
|
|
1036
|
+
NotifyUrgentFramesWriteDone();
|
|
1037
|
+
WriteCycle& write_cycle = transport_write_context_.GetWriteCycle();
|
|
1038
|
+
// Drain all the writable streams till we have written
|
|
1039
|
+
// max_write_size_ bytes of data or there is no more data to send.
|
|
1040
|
+
// In some cases, we may write more than max_write_size_ bytes(like
|
|
1041
|
+
// writing metadata).
|
|
1042
|
+
while (write_cycle.GetWriteBytesRemaining() > 0) {
|
|
1043
|
+
std::optional<RefCountedPtr<Stream>> optional_stream =
|
|
1044
|
+
writable_stream_list_.ImmediateNext(
|
|
1045
|
+
AreTransportFlowControlTokensAvailable());
|
|
1046
|
+
if (!optional_stream.has_value()) {
|
|
1047
|
+
GRPC_HTTP2_CLIENT_DLOG
|
|
1048
|
+
<< "Http2ServerTransport::MultiplexerLoop "
|
|
1049
|
+
"No writable streams available ";
|
|
1050
|
+
break;
|
|
1051
|
+
}
|
|
1052
|
+
RefCountedPtr<Stream> stream = std::move(optional_stream.value());
|
|
1053
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1054
|
+
<< "Http2ServerTransport::MultiplexerLoop "
|
|
1055
|
+
"Next writable stream id = "
|
|
1056
|
+
<< stream->GetStreamId()
|
|
1057
|
+
<< " is_closed_for_writes = " << stream->IsClosedForWrites();
|
|
1058
|
+
GRPC_DCHECK_NE(stream->GetStreamId(), kInvalidStreamId);
|
|
1059
|
+
|
|
1060
|
+
if (GPR_LIKELY(!stream->IsClosedForWrites())) {
|
|
1061
|
+
absl::Status status = DequeueStreamFrames(
|
|
1062
|
+
std::move(stream),
|
|
1063
|
+
transport_write_context_.GetWriteCycle());
|
|
1064
|
+
if (GPR_UNLIKELY(!status.ok())) {
|
|
1065
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1066
|
+
<< "Http2ServerTransport::MultiplexerLoop "
|
|
1067
|
+
"Failed to dequeue stream frames with status: "
|
|
1068
|
+
<< status;
|
|
1069
|
+
return status;
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::MultiplexerLoop "
|
|
1075
|
+
"After draining all writable streams "
|
|
1076
|
+
<< write_cycle.DebugString();
|
|
1077
|
+
|
|
1078
|
+
return absl::OkStatus();
|
|
1079
|
+
});
|
|
1080
|
+
},
|
|
1081
|
+
[this]() {
|
|
1082
|
+
return Map(SerializeAndWrite(), [this](absl::Status status) {
|
|
1083
|
+
if (GPR_UNLIKELY(!status.ok())) {
|
|
1084
|
+
return status;
|
|
1085
|
+
}
|
|
1086
|
+
NotifyFramesWriteDone();
|
|
1087
|
+
return absl::OkStatus();
|
|
1088
|
+
});
|
|
1089
|
+
},
|
|
1090
|
+
[this]() -> LoopCtl<absl::Status> {
|
|
1091
|
+
if (should_reset_ping_clock_) {
|
|
1092
|
+
GRPC_HTTP2_CLIENT_DLOG
|
|
1093
|
+
<< "Http2ClientTransport::MultiplexerLoop ResetPingClock";
|
|
1094
|
+
ping_manager_->ResetPingClock(/*is_client=*/kIsClient);
|
|
1095
|
+
should_reset_ping_clock_ = false;
|
|
1096
|
+
}
|
|
1097
|
+
transport_write_context_.EndWriteCycle();
|
|
1098
|
+
return Continue();
|
|
1099
|
+
});
|
|
1100
|
+
}));
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
1104
|
+
// Settings
|
|
1105
|
+
|
|
1106
|
+
void Http2ServerTransport::EnforceLatestIncomingSettings() {
|
|
1107
|
+
encoder_.SetMaxTableSize(settings_->peer().header_table_size());
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
auto Http2ServerTransport::WaitForSettingsTimeoutOnDone() {
|
|
1111
|
+
return [self = RefAsSubclass<Http2ServerTransport>()](absl::Status status) {
|
|
1112
|
+
if (!status.ok()) {
|
|
1113
|
+
GRPC_UNUSED absl::Status result = self->HandleError(
|
|
1114
|
+
/*stream=*/nullptr, Http2Status::Http2ConnectionError(
|
|
1115
|
+
Http2ErrorCode::kProtocolError,
|
|
1116
|
+
std::string(RFC9113::kSettingsTimeout)));
|
|
1117
|
+
}
|
|
1118
|
+
};
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
void Http2ServerTransport::MaybeSpawnWaitForSettingsTimeout() {
|
|
1122
|
+
if (settings_->ShouldSpawnWaitForSettingsTimeout()) {
|
|
1123
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1124
|
+
<< "Http2ServerTransport::MaybeSpawnWaitForSettingsTimeout Spawning";
|
|
1125
|
+
SpawnWithOnDoneTransportParty("WaitForSettingsTimeout",
|
|
1126
|
+
settings_->WaitForSettingsTimeout(),
|
|
1127
|
+
WaitForSettingsTimeoutOnDone());
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
1132
|
+
// Flow Control and BDP
|
|
1133
|
+
|
|
1134
|
+
// Equivalent to grpc_chttp2_act_on_flowctl_action in chttp2_transport.cc
|
|
1135
|
+
void Http2ServerTransport::ActOnFlowControlAction(
|
|
1136
|
+
const chttp2::FlowControlAction& action, Stream* stream) {
|
|
1137
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::ActOnFlowControlAction"
|
|
1138
|
+
<< action.DebugString();
|
|
1139
|
+
if (action.send_stream_update() != kNoActionNeeded) {
|
|
1140
|
+
if (GPR_LIKELY(stream != nullptr)) {
|
|
1141
|
+
GRPC_DCHECK_GT(stream->GetStreamId(), 0u);
|
|
1142
|
+
if (stream->CanSendWindowUpdateFrames()) {
|
|
1143
|
+
flow_control_.AddStreamToWindowUpdateList(stream->GetStreamId());
|
|
1144
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1145
|
+
<< "Http2ServerTransport::ActOnFlowControlAction "
|
|
1146
|
+
"added stream "
|
|
1147
|
+
<< stream->GetStreamId() << " to window_update_list_";
|
|
1148
|
+
}
|
|
1149
|
+
} else {
|
|
1150
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1151
|
+
<< "Http2ServerTransport::ActOnFlowControlAction stream is null";
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
ActOnFlowControlActionSettings(action, settings_->mutable_local());
|
|
1156
|
+
|
|
1157
|
+
if (action.AnyUpdateImmediately()) {
|
|
1158
|
+
// Prioritize sending flow control updates over reading data. If we
|
|
1159
|
+
// continue reading while urgent flow control updates are pending, we might
|
|
1160
|
+
// exhaust the flow control window. This prevents us from sending window
|
|
1161
|
+
// updates to the peer, causing the peer to block unnecessarily while
|
|
1162
|
+
// waiting for flow control tokens.
|
|
1163
|
+
read_context_.SetPauseReadLoop();
|
|
1164
|
+
if (!TriggerWriteCycleOrHandleError()) {
|
|
1165
|
+
return;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
GRPC_HTTP2_SERVER_DLOG << "Update Immediately : "
|
|
1169
|
+
<< action.ImmediateUpdateReasons();
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
void Http2ServerTransport::MaybeGetWindowUpdateFrames(
|
|
1174
|
+
FrameSender& frame_sender) {
|
|
1175
|
+
frame_sender.ReserveRegularFrames(flow_control_.window_update_list_size() +
|
|
1176
|
+
1);
|
|
1177
|
+
MaybeAddTransportWindowUpdateFrame(flow_control_, frame_sender);
|
|
1178
|
+
for (const uint32_t stream_id : flow_control_.DrainWindowUpdateList()) {
|
|
1179
|
+
RefCountedPtr<Stream> stream = LookupStream(stream_id);
|
|
1180
|
+
if (stream != nullptr) {
|
|
1181
|
+
MaybeAddStreamWindowUpdateFrame(*stream, frame_sender);
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
auto Http2ServerTransport::FlowControlPeriodicUpdateLoop() {
|
|
1187
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1188
|
+
<< "Http2ServerTransport::FlowControlPeriodicUpdateLoop Factory";
|
|
1189
|
+
return AssertResultType<absl::Status>(
|
|
1190
|
+
Loop([this]() {
|
|
1191
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1192
|
+
<< "Http2ServerTransport::FlowControlPeriodicUpdateLoop Loop";
|
|
1193
|
+
return TrySeq(
|
|
1194
|
+
// TODO(tjagtap) [PH2][P2][BDP] Remove this static sleep when the
|
|
1195
|
+
// BDP code is done.
|
|
1196
|
+
Sleep(chttp2::kFlowControlPeriodicUpdateTimer),
|
|
1197
|
+
[this]() -> Poll<absl::Status> {
|
|
1198
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1199
|
+
<< "Http2ServerTransport::FlowControlPeriodicUpdateLoop "
|
|
1200
|
+
"PeriodicUpdate()";
|
|
1201
|
+
chttp2::FlowControlAction action = flow_control_.PeriodicUpdate();
|
|
1202
|
+
bool is_action_empty = action == chttp2::FlowControlAction();
|
|
1203
|
+
// This may trigger a write cycle
|
|
1204
|
+
ActOnFlowControlAction(action, nullptr);
|
|
1205
|
+
if (is_action_empty) {
|
|
1206
|
+
// TODO(tjagtap) [PH2][P2][BDP] Remove this when the BDP code is
|
|
1207
|
+
// done. We must continue to do PeriodicUpdate once BDP is in
|
|
1208
|
+
// place.
|
|
1209
|
+
MutexLock lock(&transport_mutex_);
|
|
1210
|
+
if (GetActiveStreamCountLocked() == 0) {
|
|
1211
|
+
AddPeriodicUpdatePromiseWaker();
|
|
1212
|
+
return Pending{};
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
return absl::OkStatus();
|
|
1216
|
+
},
|
|
1217
|
+
[]() -> LoopCtl<absl::Status> { return Continue{}; });
|
|
1218
|
+
}));
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
1222
|
+
// Stream List Operations
|
|
1223
|
+
|
|
1224
|
+
RefCountedPtr<Stream> Http2ServerTransport::LookupStream(uint32_t stream_id) {
|
|
1225
|
+
MutexLock lock(&transport_mutex_);
|
|
1226
|
+
auto it = stream_list_.find(stream_id);
|
|
1227
|
+
if (it == stream_list_.end()) {
|
|
1228
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1229
|
+
<< "Http2ServerTransport::LookupStream Stream not found stream_id="
|
|
1230
|
+
<< stream_id;
|
|
1231
|
+
return nullptr;
|
|
1232
|
+
}
|
|
1233
|
+
return it->second;
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
void Http2ServerTransport::AddToStreamList(RefCountedPtr<Stream> stream) {
|
|
1237
|
+
bool should_wake_periodic_updates = false;
|
|
1238
|
+
{
|
|
1239
|
+
MutexLock lock(&transport_mutex_);
|
|
1240
|
+
GRPC_DCHECK(stream != nullptr) << "stream is null";
|
|
1241
|
+
GRPC_DCHECK_GT(stream->GetStreamId(), 0u) << "stream id is invalid";
|
|
1242
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1243
|
+
<< "Http2ServerTransport::AddToStreamList for stream id: "
|
|
1244
|
+
<< stream->GetStreamId();
|
|
1245
|
+
const uint32_t stream_id = stream->GetStreamId();
|
|
1246
|
+
stream_list_.emplace(stream_id, std::move(stream));
|
|
1247
|
+
// TODO(tjagtap) [PH2][P2][BDP] Remove this when the BDP code is done.
|
|
1248
|
+
if (GetActiveStreamCountLocked() == 1) {
|
|
1249
|
+
should_wake_periodic_updates = true;
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
// TODO(tjagtap) [PH2][P2][BDP] Remove this when the BDP code is done.
|
|
1253
|
+
if (should_wake_periodic_updates) {
|
|
1254
|
+
// Release the lock before you wake up another promise on the party.
|
|
1255
|
+
WakeupPeriodicUpdatePromise();
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
absl::Status Http2ServerTransport::MaybeAddStreamToWritableStreamList(
|
|
1260
|
+
RefCountedPtr<Stream> stream,
|
|
1261
|
+
const StreamDataQueue<ServerMetadataHandle>::StreamWritabilityUpdate
|
|
1262
|
+
result) {
|
|
1263
|
+
if (result.became_writable) {
|
|
1264
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1265
|
+
<< "Http2ServerTransport::MaybeAddStreamToWritableStreamList Stream "
|
|
1266
|
+
"id: "
|
|
1267
|
+
<< stream->GetStreamId() << " became writable";
|
|
1268
|
+
// TODO(akshitpatel) [PH2][P4][Perf]: Might be worth exploring if this
|
|
1269
|
+
// function should take a raw stream ptr and take a ref here.
|
|
1270
|
+
absl::Status status =
|
|
1271
|
+
writable_stream_list_.Enqueue(std::move(stream), result.priority);
|
|
1272
|
+
if (!status.ok()) {
|
|
1273
|
+
return HandleError(
|
|
1274
|
+
/*stream=*/nullptr,
|
|
1275
|
+
Http2Status::Http2ConnectionError(
|
|
1276
|
+
Http2ErrorCode::kRefusedStream,
|
|
1277
|
+
std::string(GrpcErrors::kFailedToEnqueueStream)));
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
return absl::OkStatus();
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
1284
|
+
// Stream Operations
|
|
1285
|
+
auto Http2ServerTransport::HandleMetadataAndMessages(
|
|
1286
|
+
RefCountedPtr<Stream> stream) {
|
|
1287
|
+
auto send_message = [this, stream](MessageHandle&& message) mutable {
|
|
1288
|
+
return TrySeq(HandleStreamErrorOnFailure(
|
|
1289
|
+
stream->EnqueueMessage(std::move(message)), stream),
|
|
1290
|
+
[this, stream](const StreamWritabilityUpdate result) mutable {
|
|
1291
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1292
|
+
<< "Http2ServerTransport::HandleMetadataAndMessages "
|
|
1293
|
+
"Enqueued Message";
|
|
1294
|
+
return MaybeAddStreamToWritableStreamList(std::move(stream),
|
|
1295
|
+
result);
|
|
1296
|
+
});
|
|
1297
|
+
};
|
|
1298
|
+
|
|
1299
|
+
auto send_initial_metadata = [this, stream](
|
|
1300
|
+
ServerMetadataHandle&& metadata) mutable {
|
|
1301
|
+
absl::StatusOr<StreamWritabilityUpdate> enqueue_result =
|
|
1302
|
+
stream->EnqueueInitialMetadata(
|
|
1303
|
+
std::forward<ServerMetadataHandle>(metadata));
|
|
1304
|
+
if (GPR_UNLIKELY(!enqueue_result.ok())) {
|
|
1305
|
+
absl::Status status = enqueue_result.status();
|
|
1306
|
+
GRPC_UNUSED absl::Status unused = HandleError(
|
|
1307
|
+
stream, Http2Status::AbslStreamError(status.code(),
|
|
1308
|
+
std::string(status.message())));
|
|
1309
|
+
return status;
|
|
1310
|
+
}
|
|
1311
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::HandleMetadataAndMessages "
|
|
1312
|
+
"Enqueued Initial Metadata";
|
|
1313
|
+
return MaybeAddStreamToWritableStreamList(std::move(stream),
|
|
1314
|
+
enqueue_result.value());
|
|
1315
|
+
};
|
|
1316
|
+
|
|
1317
|
+
return TrySeq(
|
|
1318
|
+
Map(stream->GetCallInitiator().PullServerInitialMetadata(),
|
|
1319
|
+
[send_initial_metadata = std::move(send_initial_metadata)](
|
|
1320
|
+
std::optional<ServerMetadataHandle> initial_metadata) mutable {
|
|
1321
|
+
if (initial_metadata.has_value()) {
|
|
1322
|
+
return send_initial_metadata(std::move(initial_metadata).value());
|
|
1323
|
+
}
|
|
1324
|
+
return absl::OkStatus();
|
|
1325
|
+
}),
|
|
1326
|
+
ForEach(MessagesFrom(stream->GetCallInitiator()),
|
|
1327
|
+
std::move(send_message)));
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
auto Http2ServerTransport::CallOutboundLoop(RefCountedPtr<Stream> stream) {
|
|
1331
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::CallOutboundLoop";
|
|
1332
|
+
GRPC_DCHECK(stream != nullptr);
|
|
1333
|
+
|
|
1334
|
+
auto send_trailing_metadata =
|
|
1335
|
+
[this, stream](ServerMetadataHandle&& metadata) mutable {
|
|
1336
|
+
absl::StatusOr<StreamWritabilityUpdate> enqueue_result =
|
|
1337
|
+
stream->EnqueueTrailingMetadata(std::move(metadata));
|
|
1338
|
+
if (GPR_UNLIKELY(!enqueue_result.ok())) {
|
|
1339
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1340
|
+
<< "Http2ServerTransport::CallOutboundLoop Failed to enqueue "
|
|
1341
|
+
"trailing metadata: "
|
|
1342
|
+
<< enqueue_result.status();
|
|
1343
|
+
return enqueue_result.status();
|
|
1344
|
+
}
|
|
1345
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::CallOutboundLoop "
|
|
1346
|
+
"Enqueued Trailing Metadata";
|
|
1347
|
+
return MaybeAddStreamToWritableStreamList(std::move(stream),
|
|
1348
|
+
enqueue_result.value());
|
|
1349
|
+
};
|
|
1350
|
+
|
|
1351
|
+
return GRPC_LATENT_SEE_PROMISE(
|
|
1352
|
+
"Ph2CallOutboundLoop",
|
|
1353
|
+
Seq(Map(HandleMetadataAndMessages(stream),
|
|
1354
|
+
[stream = stream.get()](absl::Status&& status) {
|
|
1355
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1356
|
+
<< "Http2ServerTransport::CallOutboundLoop "
|
|
1357
|
+
"Completed initial metadata and messages with status: "
|
|
1358
|
+
<< status;
|
|
1359
|
+
return Empty{};
|
|
1360
|
+
}),
|
|
1361
|
+
[stream, send_trailing_metadata =
|
|
1362
|
+
std::move(send_trailing_metadata)]() mutable {
|
|
1363
|
+
return Map(
|
|
1364
|
+
stream->GetCallInitiator().PullServerTrailingMetadata(),
|
|
1365
|
+
[send_trailing_metadata = std::move(send_trailing_metadata)](
|
|
1366
|
+
ServerMetadataHandle&& metadata) mutable {
|
|
1367
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1368
|
+
<< "Http2ServerTransport::CallOutboundLoop "
|
|
1369
|
+
"Received Server Trailing Metadata";
|
|
1370
|
+
return send_trailing_metadata(std::move(metadata));
|
|
1371
|
+
});
|
|
1372
|
+
}));
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
absl::Status Http2ServerTransport::InitializeStream(
|
|
1376
|
+
GRPC_UNUSED Stream& stream) {
|
|
1377
|
+
GRPC_DCHECK(false) << "Should not be called for server";
|
|
1378
|
+
return absl::OkStatus();
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
std::optional<RefCountedPtr<Stream>> Http2ServerTransport::MakeStream(
|
|
1382
|
+
CallInitiator&& call_initiator, const uint32_t stream_id) {
|
|
1383
|
+
RefCountedPtr<Stream> stream =
|
|
1384
|
+
MakeRefCounted<Stream>(call_initiator, flow_control_, stream_id,
|
|
1385
|
+
settings_->peer().allow_true_binary_metadata());
|
|
1386
|
+
const bool on_done_added = SetOnDone(stream);
|
|
1387
|
+
if (!on_done_added) return std::nullopt;
|
|
1388
|
+
return std::move(stream);
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
Http2Status Http2ServerTransport::IncomingStream(
|
|
1392
|
+
ClientMetadataHandle&& metadata, const uint32_t stream_id) {
|
|
1393
|
+
{
|
|
1394
|
+
MutexLock lock(&transport_mutex_);
|
|
1395
|
+
if (is_transport_closed_) {
|
|
1396
|
+
return Http2Status::Http2ConnectionError(Http2ErrorCode::kRefusedStream,
|
|
1397
|
+
"Transport is closed.");
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
GRPC_DCHECK(LookupStream(stream_id) == nullptr);
|
|
1402
|
+
|
|
1403
|
+
// TODO(tjagtap) : [PH2][P1] : Evaluate use of
|
|
1404
|
+
// SimpleArenaAllocator vs CallArenaAllocator here.
|
|
1405
|
+
RefCountedPtr<Arena> arena = SimpleArenaAllocator(0)->MakeArena();
|
|
1406
|
+
arena->SetContext<EventEngine>(event_engine_.get());
|
|
1407
|
+
CallInitiatorAndHandler call =
|
|
1408
|
+
MakeCallPair(std::move(metadata), std::move(arena));
|
|
1409
|
+
|
|
1410
|
+
// TODO(akshitpatel) : [PH2][P2] : For the server side, MakeStream most likely
|
|
1411
|
+
// will not fail. Evaluate this.
|
|
1412
|
+
std::optional<RefCountedPtr<Stream>> result =
|
|
1413
|
+
MakeStream(std::move(call.initiator), stream_id);
|
|
1414
|
+
if (!result.has_value()) {
|
|
1415
|
+
return Http2Status::Http2StreamError(
|
|
1416
|
+
Http2ErrorCode::kInternalError,
|
|
1417
|
+
std::string(GrpcErrors::kStreamCreationFailed));
|
|
1418
|
+
}
|
|
1419
|
+
RefCountedPtr<Stream> stream = std::move(result.value());
|
|
1420
|
+
AddToStreamList(stream);
|
|
1421
|
+
stream->SetInitialMetadataReceived();
|
|
1422
|
+
|
|
1423
|
+
stream->GetCallInitiator().SpawnGuarded(
|
|
1424
|
+
"CallOutboundLoop",
|
|
1425
|
+
[self = RefAsSubclass<Http2ServerTransport>(), stream = std::move(stream),
|
|
1426
|
+
call_handler = std::move(call.handler)]() mutable {
|
|
1427
|
+
self->call_destination_->StartCall(std::move(call_handler));
|
|
1428
|
+
return Map(self->CallOutboundLoop(std::move(stream)),
|
|
1429
|
+
[self](absl::Status status) { return status; });
|
|
1430
|
+
});
|
|
1431
|
+
return Http2Status::Ok();
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
void Http2ServerTransport::BeginCloseStream(
|
|
1435
|
+
RefCountedPtr<Stream> stream, uint32_t reset_stream_error_code,
|
|
1436
|
+
absl::Status trailing_metadata_status, DebugLocation whence) {
|
|
1437
|
+
GRPC_DCHECK(!trailing_metadata_status.ok());
|
|
1438
|
+
if (stream == nullptr) {
|
|
1439
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::BeginCloseStream stream"
|
|
1440
|
+
"is null reset_stream_error_code="
|
|
1441
|
+
<< reset_stream_error_code
|
|
1442
|
+
<< " status=" << trailing_metadata_status;
|
|
1443
|
+
return;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1447
|
+
<< "Http2ServerTransport::BeginCloseStream for stream id: "
|
|
1448
|
+
<< stream->GetStreamId() << " error_code=" << reset_stream_error_code
|
|
1449
|
+
<< " Status=" << trailing_metadata_status << " location=" << whence.file()
|
|
1450
|
+
<< ":" << whence.line();
|
|
1451
|
+
|
|
1452
|
+
// Enqueue RST_STREAM.
|
|
1453
|
+
absl::StatusOr<StreamWritabilityUpdate> enqueue_result =
|
|
1454
|
+
stream->EnqueueResetStream(reset_stream_error_code);
|
|
1455
|
+
GRPC_HTTP2_SERVER_DLOG << "Enqueued ResetStream with error code="
|
|
1456
|
+
<< reset_stream_error_code
|
|
1457
|
+
<< " status=" << enqueue_result.status();
|
|
1458
|
+
if (enqueue_result.ok()) {
|
|
1459
|
+
GRPC_UNUSED absl::Status status =
|
|
1460
|
+
MaybeAddStreamToWritableStreamList(stream, enqueue_result.value());
|
|
1461
|
+
}
|
|
1462
|
+
HandleStreamStateChange(
|
|
1463
|
+
*stream, stream->OnInitiateReset(std::move(trailing_metadata_status)));
|
|
1464
|
+
read_context_.OnResetFrameEnqueued(reset_stream_error_code);
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
void Http2ServerTransport::HandleStreamStateChange(Stream& stream,
|
|
1468
|
+
StreamStateChange change) {
|
|
1469
|
+
if (change.reads_became_closed) {
|
|
1470
|
+
// If a stream is closing for reads and was actively waiting for a
|
|
1471
|
+
// continuation frame, parse the buffered HEADER/CONTINUATION frames
|
|
1472
|
+
if (read_context_.IsWaitingForContinuationFrame() &&
|
|
1473
|
+
read_context_.GetStreamId() == stream.GetStreamId()) {
|
|
1474
|
+
Http2Status result = read_context_.ParseAndDiscardHeaders(
|
|
1475
|
+
SliceBuffer(), /*is_end_headers=*/false,
|
|
1476
|
+
/*original_status=*/Http2Status::Ok(),
|
|
1477
|
+
settings_->acked().max_header_list_size());
|
|
1478
|
+
if (result.GetType() == Http2Status::Http2ErrorType::kConnectionError) {
|
|
1479
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1480
|
+
<< "Http2ServerTransport::HandleStreamStateChange (DiscardHeaders) "
|
|
1481
|
+
"for stream id: "
|
|
1482
|
+
<< stream.GetStreamId()
|
|
1483
|
+
<< " failed to partially process header : " << result.DebugString();
|
|
1484
|
+
GRPC_UNUSED absl::Status status =
|
|
1485
|
+
HandleError(/*stream=*/nullptr, std::move(result));
|
|
1486
|
+
return;
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
if (change.stream_became_closed) {
|
|
1491
|
+
CleanupStream(stream);
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
void Http2ServerTransport::CleanupStream(Stream& stream) {
|
|
1496
|
+
bool should_close = false;
|
|
1497
|
+
{
|
|
1498
|
+
MutexLock lock(&transport_mutex_);
|
|
1499
|
+
stream_list_.erase(stream.GetStreamId());
|
|
1500
|
+
// Close transport if graceful GOAWAY has been sent and there are no more
|
|
1501
|
+
// streams.
|
|
1502
|
+
if (goaway_manager_.IsFinalGracefulGoawaySent() && stream_list_.empty()) {
|
|
1503
|
+
should_close = true;
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
if (should_close) {
|
|
1507
|
+
MaybeSpawnCloseTransport(Http2Status::AbslConnectionError(
|
|
1508
|
+
absl::StatusCode::kUnavailable, "Graceful shutdown complete."));
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
absl::Status Http2ServerTransport::UpdateAllStreamsWritability() {
|
|
1513
|
+
MutexLock lock(&transport_mutex_);
|
|
1514
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1515
|
+
<< "Http2ServerTransport::UpdateAllStreamsWritability total streams: "
|
|
1516
|
+
<< stream_list_.size();
|
|
1517
|
+
// This loop iterates over all active streams. For each stream this would
|
|
1518
|
+
// internally take a stream specific lock and update the stream writability.
|
|
1519
|
+
// This is not optimal but should be fine as this function is only called when
|
|
1520
|
+
// initial window size is increased which in theory should not be very
|
|
1521
|
+
// frequent.
|
|
1522
|
+
for (const auto& [stream_id, stream] : stream_list_) {
|
|
1523
|
+
StreamWritabilityUpdate update =
|
|
1524
|
+
stream->UpdateStreamWritability(GetStreamFlowControlTokens(
|
|
1525
|
+
stream->GetStreamFlowControl(), settings_->peer()));
|
|
1526
|
+
absl::Status status = MaybeAddStreamToWritableStreamList(stream, update);
|
|
1527
|
+
if (GPR_UNLIKELY(!status.ok())) {
|
|
1528
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::"
|
|
1529
|
+
"UpdateAllStreamsWritability failed for stream "
|
|
1530
|
+
<< stream_id << " with status " << status;
|
|
1531
|
+
return status;
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
return absl::OkStatus();
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
1539
|
+
// Ping Keepalive and Goaway
|
|
1540
|
+
|
|
1541
|
+
void Http2ServerTransport::MaybeSpawnPingTimeout(
|
|
1542
|
+
std::optional<uint64_t> opaque_data) {
|
|
1543
|
+
if (opaque_data.has_value()) {
|
|
1544
|
+
SpawnGuardedTransportParty(
|
|
1545
|
+
"PingTimeout", [self = RefAsSubclass<Http2ServerTransport>(),
|
|
1546
|
+
opaque_data = *opaque_data]() {
|
|
1547
|
+
return self->ping_manager_->TimeoutPromise(opaque_data);
|
|
1548
|
+
});
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
void Http2ServerTransport::MaybeSpawnDelayedPing(
|
|
1552
|
+
std::optional<Duration> delayed_ping_wait) {
|
|
1553
|
+
if (delayed_ping_wait.has_value()) {
|
|
1554
|
+
SpawnGuardedTransportParty(
|
|
1555
|
+
"DelayedPing", [self = RefAsSubclass<Http2ServerTransport>(),
|
|
1556
|
+
wait = *delayed_ping_wait]() {
|
|
1557
|
+
GRPC_HTTP2_PING_LOG << "Scheduling delayed ping after wait=" << wait;
|
|
1558
|
+
return self->ping_manager_->DelayedPingPromise(wait);
|
|
1559
|
+
});
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
absl::Status Http2ServerTransport::AckPing(uint64_t opaque_data) {
|
|
1564
|
+
// It is possible that the PingRatePolicy may decide to not send a ping
|
|
1565
|
+
// request (in cases like the number of inflight pings is too high).
|
|
1566
|
+
// When this happens, it becomes important to ensure that if a ping ack
|
|
1567
|
+
// is received and there is an "important" outstanding ping request, we
|
|
1568
|
+
// should retry to send it out now.
|
|
1569
|
+
if (ping_manager_->AckPing(opaque_data)) {
|
|
1570
|
+
if (ping_manager_->ImportantPingRequested()) {
|
|
1571
|
+
return TriggerWriteCycle();
|
|
1572
|
+
}
|
|
1573
|
+
} else {
|
|
1574
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::AckPing Unknown ping "
|
|
1575
|
+
"response received for ping id="
|
|
1576
|
+
<< opaque_data;
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
return absl::OkStatus();
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
void Http2ServerTransport::MaybeSpawnKeepaliveLoop() {
|
|
1583
|
+
if (keepalive_manager_->IsKeepAliveLoopNeeded()) {
|
|
1584
|
+
SpawnGuardedTransportParty(
|
|
1585
|
+
"KeepaliveLoop", [self = RefAsSubclass<Http2ServerTransport>()]() {
|
|
1586
|
+
return self->keepalive_manager_->KeepaliveLoop();
|
|
1587
|
+
});
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
auto Http2ServerTransport::SpawnGracefulGoawayPromise(Slice&& debug_data) {
|
|
1592
|
+
SpawnGuardedTransportParty(
|
|
1593
|
+
"GracefulGoaway",
|
|
1594
|
+
[self = RefAsSubclass<Http2ServerTransport>(),
|
|
1595
|
+
debug_data = std::forward<Slice>(debug_data)]() mutable {
|
|
1596
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1597
|
+
<< "Http2ServerTransport::SpawnGracefulGoawayPromise: "
|
|
1598
|
+
"Initiated graceful GOAWAY";
|
|
1599
|
+
return self->UntilTransportClosed(Map(
|
|
1600
|
+
self->goaway_manager_.RequestGoaway(
|
|
1601
|
+
Http2ErrorCode::kNoError, std::move(debug_data),
|
|
1602
|
+
self->last_incoming_stream_id_, /*immediate=*/false),
|
|
1603
|
+
[self](absl::Status status) {
|
|
1604
|
+
bool should_close = false;
|
|
1605
|
+
{
|
|
1606
|
+
MutexLock lock(&self->transport_mutex_);
|
|
1607
|
+
if (self->GetActiveStreamCountLocked() == 0) {
|
|
1608
|
+
should_close = true;
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
if (should_close) {
|
|
1612
|
+
self->MaybeSpawnCloseTransport(Http2Status::AbslConnectionError(
|
|
1613
|
+
absl::StatusCode::kUnavailable,
|
|
1614
|
+
"Graceful shutdown complete."));
|
|
1615
|
+
}
|
|
1616
|
+
return status;
|
|
1617
|
+
}));
|
|
1618
|
+
});
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
1622
|
+
// Error Path and Close Path
|
|
1623
|
+
|
|
1624
|
+
absl::Status Http2ServerTransport::HandleError(RefCountedPtr<Stream> stream,
|
|
1625
|
+
Http2Status status,
|
|
1626
|
+
DebugLocation whence) {
|
|
1627
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::HandleError for stream id="
|
|
1628
|
+
<< (stream != nullptr
|
|
1629
|
+
? absl::StrCat(stream->GetStreamId())
|
|
1630
|
+
: "nullopt")
|
|
1631
|
+
<< " status=" << status.DebugString()
|
|
1632
|
+
<< " location=" << whence.file() << ":"
|
|
1633
|
+
<< whence.line();
|
|
1634
|
+
Http2Status::Http2ErrorType error_type = status.GetType();
|
|
1635
|
+
GRPC_DCHECK(error_type != Http2Status::Http2ErrorType::kOk);
|
|
1636
|
+
|
|
1637
|
+
if (error_type == Http2Status::Http2ErrorType::kConnectionError) {
|
|
1638
|
+
GRPC_DCHECK(stream == nullptr);
|
|
1639
|
+
absl::Status absl_status = status.GetAbslConnectionError();
|
|
1640
|
+
MaybeSpawnCloseTransport(std::move(status), whence);
|
|
1641
|
+
return absl_status;
|
|
1642
|
+
} else if (error_type == Http2Status::Http2ErrorType::kStreamError) {
|
|
1643
|
+
uint32_t reset_stream_error_code =
|
|
1644
|
+
Http2ErrorCodeToFrameErrorCode(status.GetStreamErrorCode());
|
|
1645
|
+
if (stream != nullptr) {
|
|
1646
|
+
BeginCloseStream(std::move(stream), reset_stream_error_code,
|
|
1647
|
+
status.GetAbslStreamError(), whence);
|
|
1648
|
+
}
|
|
1649
|
+
return absl::OkStatus();
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
GPR_UNREACHABLE_CODE(return absl::InternalError("Invalid error type"));
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
void Http2ServerTransport::MaybeSpawnCloseTransport(Http2Status http2_status,
|
|
1656
|
+
DebugLocation whence) {
|
|
1657
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::MaybeSpawnCloseTransport "
|
|
1658
|
+
"status="
|
|
1659
|
+
<< http2_status.DebugString()
|
|
1660
|
+
<< " location=" << whence.file() << ":"
|
|
1661
|
+
<< whence.line();
|
|
1662
|
+
|
|
1663
|
+
ReleasableMutexLock lock(&transport_mutex_);
|
|
1664
|
+
if (is_transport_closed_) {
|
|
1665
|
+
lock.Release();
|
|
1666
|
+
return;
|
|
1667
|
+
}
|
|
1668
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::MaybeSpawnCloseTransport "
|
|
1669
|
+
"Initiating transport close";
|
|
1670
|
+
is_transport_closed_ = true;
|
|
1671
|
+
absl::flat_hash_map<uint32_t, RefCountedPtr<Stream>> stream_list =
|
|
1672
|
+
std::move(stream_list_);
|
|
1673
|
+
stream_list_.clear();
|
|
1674
|
+
ReportDisconnectionLocked(
|
|
1675
|
+
GRPC_CHANNEL_SHUTDOWN, http2_status.GetAbslConnectionError(), {},
|
|
1676
|
+
absl::StrCat("Transport closed: ", http2_status.DebugString()).c_str());
|
|
1677
|
+
lock.Release();
|
|
1678
|
+
|
|
1679
|
+
SpawnInfallibleTransportParty(
|
|
1680
|
+
"CloseTransport",
|
|
1681
|
+
[self = RefAsSubclass<Http2ServerTransport>(),
|
|
1682
|
+
stream_list = std::move(stream_list),
|
|
1683
|
+
http2_status = std::move(http2_status), whence]() mutable {
|
|
1684
|
+
self->security_frame_handler_->OnTransportClosed();
|
|
1685
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1686
|
+
<< "Http2ServerTransport::MaybeSpawnCloseTransport "
|
|
1687
|
+
"Cleaning up call stacks";
|
|
1688
|
+
// Clean up the call stacks for all active streams.
|
|
1689
|
+
for (const auto& pair : stream_list) {
|
|
1690
|
+
RefCountedPtr<Stream> stream = pair.second;
|
|
1691
|
+
self->BeginCloseStream(std::move(stream),
|
|
1692
|
+
Http2ErrorCodeToFrameErrorCode(
|
|
1693
|
+
http2_status.GetConnectionErrorCode()),
|
|
1694
|
+
http2_status.GetAbslConnectionError(), whence);
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
// Sleep for kGoawaySendTimeoutSeconds before closing the transport to
|
|
1698
|
+
// let write buffers drain.
|
|
1699
|
+
return Map(
|
|
1700
|
+
Race(AssertResultType<absl::Status>(
|
|
1701
|
+
self->goaway_manager_.RequestGoaway(
|
|
1702
|
+
http2_status.GetConnectionErrorCode(),
|
|
1703
|
+
Slice::FromCopiedString(std::string(
|
|
1704
|
+
http2_status.GetAbslConnectionError().message())),
|
|
1705
|
+
self->last_incoming_stream_id_, /*immediate=*/true)),
|
|
1706
|
+
Sleep(Duration::Seconds(kGoawaySendTimeoutSeconds))),
|
|
1707
|
+
[self](auto) mutable {
|
|
1708
|
+
self->CloseTransport();
|
|
1709
|
+
return Empty{};
|
|
1710
|
+
});
|
|
1711
|
+
});
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
void Http2ServerTransport::CloseTransport() {
|
|
1715
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::CloseTransport";
|
|
1716
|
+
|
|
1717
|
+
transport_closed_latch_.Set();
|
|
1718
|
+
settings_->HandleTransportShutdown(event_engine_.get());
|
|
1719
|
+
|
|
1720
|
+
if (on_close_callback_ != nullptr) {
|
|
1721
|
+
ExecCtx::Run(DEBUG_LOCATION, on_close_callback_, absl::OkStatus());
|
|
1722
|
+
on_close_callback_ = nullptr;
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
general_party_.reset();
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
1729
|
+
// Misc Transport Stuff
|
|
1730
|
+
|
|
1731
|
+
void Http2ServerTransport::ReportDisconnection(
|
|
1732
|
+
const grpc_connectivity_state state, const absl::Status& status,
|
|
1733
|
+
StateWatcher::DisconnectInfo disconnect_info, const char* reason) {
|
|
1734
|
+
MutexLock lock(&transport_mutex_);
|
|
1735
|
+
ReportDisconnectionLocked(state, status, disconnect_info, reason);
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
void Http2ServerTransport::ReportDisconnectionLocked(
|
|
1739
|
+
const grpc_connectivity_state state, const absl::Status& status,
|
|
1740
|
+
StateWatcher::DisconnectInfo disconnect_info, const char* reason) {
|
|
1741
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1742
|
+
<< "Http2ServerTransport::ReportDisconnectionLocked status="
|
|
1743
|
+
<< status.ToString() << "; reason=" << reason;
|
|
1744
|
+
state_tracker_.SetState(state, status, reason);
|
|
1745
|
+
NotifyStateWatcherOnDisconnectLocked(status, disconnect_info);
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
bool Http2ServerTransport::SetOnDone(RefCountedPtr<Stream> stream) {
|
|
1749
|
+
// TODO(akshitpatel) : [PH2][P0] : Implement this.
|
|
1750
|
+
return stream->GetCallInitiator().OnDone(
|
|
1751
|
+
[self = RefAsSubclass<Http2ServerTransport>(),
|
|
1752
|
+
stream = std::move(stream)](GRPC_UNUSED bool cancelled) mutable {});
|
|
1753
|
+
}
|
|
1754
|
+
// return call_handler.OnDone([self = RefAsSubclass<Http2ServerTransport>(),
|
|
1755
|
+
// stream =
|
|
1756
|
+
// std::move(stream)](bool cancelled) mutable
|
|
1757
|
+
// {
|
|
1758
|
+
// GRPC_HTTP2_SERVER_DLOG << "PH2: Client call " << self.get()
|
|
1759
|
+
// << " id=" << stream->GetStreamId()
|
|
1760
|
+
// << " done: cancelled=" << cancelled;
|
|
1761
|
+
// absl::StatusOr<StreamWritabilityUpdate> enqueue_result;
|
|
1762
|
+
// GRPC_HTTP2_SERVER_DLOG << "PH2: Client call " << self.get()
|
|
1763
|
+
// << " id=" << stream->GetStreamId()
|
|
1764
|
+
// << " done: stream=" << stream.get()
|
|
1765
|
+
// << " cancelled=" << cancelled;
|
|
1766
|
+
|
|
1767
|
+
// // If the stream is already closed for writes, then we don't need to
|
|
1768
|
+
// // enqueue the reset stream or the half closed frame.
|
|
1769
|
+
// if (stream->IsClosedForWrites()) {
|
|
1770
|
+
// GRPC_HTTP2_SERVER_DLOG << "PH2: Client call " << self.get()
|
|
1771
|
+
// << " id=" << stream->GetStreamId()
|
|
1772
|
+
// << " done: stream already closed for writes";
|
|
1773
|
+
// return;
|
|
1774
|
+
// }
|
|
1775
|
+
|
|
1776
|
+
// if (cancelled) {
|
|
1777
|
+
// // In most of the cases, EnqueueResetStream would be a no-op as
|
|
1778
|
+
// // BeginCloseStream would have already enqueued the reset stream.
|
|
1779
|
+
// // Currently only Aborts from application will actually enqueue
|
|
1780
|
+
// // the reset stream here.
|
|
1781
|
+
// enqueue_result = stream->EnqueueResetStream(
|
|
1782
|
+
// static_cast<uint32_t>(Http2ErrorCode::kCancel));
|
|
1783
|
+
// GRPC_HTTP2_SERVER_DLOG << "Enqueued ResetStream with error code="
|
|
1784
|
+
// <<
|
|
1785
|
+
// static_cast<uint32_t>(Http2ErrorCode::kCancel)
|
|
1786
|
+
// << " status=" << enqueue_result.status();
|
|
1787
|
+
// } else {
|
|
1788
|
+
// enqueue_result = stream->EnqueueHalfClosed();
|
|
1789
|
+
// GRPC_HTTP2_SERVER_DLOG << "Enqueued HalfClosed with result="
|
|
1790
|
+
// << enqueue_result.status();
|
|
1791
|
+
// }
|
|
1792
|
+
|
|
1793
|
+
// if (GPR_LIKELY(enqueue_result.ok())) {
|
|
1794
|
+
// GRPC_HTTP2_SERVER_DLOG
|
|
1795
|
+
// << "Http2ServerTransport::SetOnDone "
|
|
1796
|
+
// "MaybeAddStreamToWritableStreamList for stream= "
|
|
1797
|
+
// << stream->GetStreamId() << " enqueue_result={became_writable="
|
|
1798
|
+
// << enqueue_result.value().became_writable << ", priority="
|
|
1799
|
+
// << static_cast<uint8_t>(enqueue_result.value().priority) << "}";
|
|
1800
|
+
// GRPC_UNUSED absl::Status status =
|
|
1801
|
+
// self->MaybeAddStreamToWritableStreamList(std::move(stream),
|
|
1802
|
+
// enqueue_result.value());
|
|
1803
|
+
// }
|
|
1804
|
+
// });
|
|
1805
|
+
// }
|
|
1806
|
+
|
|
1807
|
+
void Http2ServerTransport::ReadChannelArgs(const ChannelArgs& channel_args,
|
|
1808
|
+
TransportChannelArgs& args) {
|
|
1809
|
+
http2::ReadChannelArgs(channel_args, args, settings_->mutable_local(),
|
|
1810
|
+
flow_control_,
|
|
1811
|
+
/*is_client=*/kIsClient);
|
|
1812
|
+
|
|
1813
|
+
// Assign the channel args to the member variables.
|
|
1814
|
+
keepalive_time_ = args.keepalive_time;
|
|
1815
|
+
read_context_.set_soft_limit(args.max_header_list_size_soft_limit);
|
|
1816
|
+
keepalive_permit_without_calls_ = args.keepalive_permit_without_calls;
|
|
1817
|
+
test_only_ack_pings_ = args.test_only_ack_pings;
|
|
1818
|
+
|
|
1819
|
+
settings_->SetSettingsTimeout(args.settings_timeout);
|
|
1820
|
+
if (args.max_usable_hpack_table_size >= 0) {
|
|
1821
|
+
encoder_.SetMaxUsableSize(args.max_usable_hpack_table_size);
|
|
1822
|
+
}
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
1826
|
+
// Inner Classes and Structs
|
|
1827
|
+
|
|
1828
|
+
std::unique_ptr<PingInterface>
|
|
1829
|
+
Http2ServerTransport::PingSystemInterfaceImpl::Make(
|
|
1830
|
+
Http2ServerTransport* transport) {
|
|
1831
|
+
return std::make_unique<PingSystemInterfaceImpl>(
|
|
1832
|
+
PingSystemInterfaceImpl(transport));
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
absl::Status Http2ServerTransport::PingSystemInterfaceImpl::TriggerWrite() {
|
|
1836
|
+
return transport_->TriggerWriteCycle();
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
Promise<absl::Status>
|
|
1840
|
+
Http2ServerTransport::PingSystemInterfaceImpl::PingTimeout() {
|
|
1841
|
+
GRPC_HTTP2_SERVER_DLOG << "PingSystemInterfaceImpl::PingTimeout at time: "
|
|
1842
|
+
<< Timestamp::Now();
|
|
1843
|
+
|
|
1844
|
+
// TODO(akshitpatel) : [PH2][P2] : The error code here has been chosen
|
|
1845
|
+
// based on CHTTP2's usage of GRPC_STATUS_UNAVAILABLE (which corresponds
|
|
1846
|
+
// to kRefusedStream). However looking at RFC9113, definition of
|
|
1847
|
+
// kRefusedStream doesn't seem to fit this case. We should revisit this
|
|
1848
|
+
// and update the error code.
|
|
1849
|
+
return Immediate(transport_->HandleError(
|
|
1850
|
+
nullptr,
|
|
1851
|
+
Http2Status::Http2ConnectionError(Http2ErrorCode::kRefusedStream,
|
|
1852
|
+
GRPC_CHTTP2_PING_TIMEOUT_STR)));
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
std::unique_ptr<KeepAliveInterface>
|
|
1856
|
+
Http2ServerTransport::KeepAliveInterfaceImpl::Make(
|
|
1857
|
+
Http2ServerTransport* transport) {
|
|
1858
|
+
return std::make_unique<KeepAliveInterfaceImpl>(
|
|
1859
|
+
KeepAliveInterfaceImpl(transport));
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
Promise<absl::Status>
|
|
1863
|
+
Http2ServerTransport::KeepAliveInterfaceImpl::SendPingAndWaitForAck() {
|
|
1864
|
+
return TrySeq(
|
|
1865
|
+
[transport = transport_] { return transport->TriggerWriteCycle(); },
|
|
1866
|
+
[transport = transport_] { return transport->WaitForPingAck(); });
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
Promise<absl::Status>
|
|
1870
|
+
Http2ServerTransport::KeepAliveInterfaceImpl::OnKeepAliveTimeout() {
|
|
1871
|
+
GRPC_HTTP2_SERVER_DLOG
|
|
1872
|
+
<< "KeepAliveInterfaceImpl::OnKeepAliveTimeout triggered";
|
|
1873
|
+
// TODO(akshitpatel) : [PH2][P2] : The error code here has been chosen
|
|
1874
|
+
// based on CHTTP2's usage of GRPC_STATUS_UNAVAILABLE (which corresponds
|
|
1875
|
+
// to kRefusedStream). However looking at RFC9113, definition of
|
|
1876
|
+
// kRefusedStream doesn't seem to fit this case. We should revisit this
|
|
1877
|
+
// and update the error code.
|
|
1878
|
+
return Immediate(transport_->HandleError(
|
|
1879
|
+
nullptr,
|
|
1880
|
+
Http2Status::Http2ConnectionError(Http2ErrorCode::kRefusedStream,
|
|
1881
|
+
GRPC_CHTTP2_KEEPALIVE_TIMEOUT_STR)));
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
bool Http2ServerTransport::KeepAliveInterfaceImpl::NeedToSendKeepAlivePing() {
|
|
1885
|
+
bool need_to_send_ping = false;
|
|
1886
|
+
{
|
|
1887
|
+
MutexLock lock(&transport_->transport_mutex_);
|
|
1888
|
+
need_to_send_ping = (transport_->keepalive_permit_without_calls_ ||
|
|
1889
|
+
transport_->GetActiveStreamCountLocked() > 0);
|
|
1890
|
+
}
|
|
1891
|
+
return need_to_send_ping;
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
std::unique_ptr<GoawayInterface>
|
|
1895
|
+
Http2ServerTransport::GoawayInterfaceImpl::Make(
|
|
1896
|
+
Http2ServerTransport* transport) {
|
|
1897
|
+
return std::make_unique<GoawayInterfaceImpl>(GoawayInterfaceImpl(transport));
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
uint32_t Http2ServerTransport::GoawayInterfaceImpl::GetLastAcceptedStreamId() {
|
|
1901
|
+
return transport_->last_incoming_stream_id_;
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
1905
|
+
// Constructor, Destructor etc.
|
|
1906
|
+
|
|
1907
|
+
Http2ServerTransport::Http2ServerTransport(
|
|
1908
|
+
PromiseEndpoint endpoint, const ChannelArgs& channel_args,
|
|
1909
|
+
std::shared_ptr<EventEngine> event_engine,
|
|
1910
|
+
absl::AnyInvocable<void(absl::StatusOr<uint32_t>)> on_receive_settings,
|
|
1911
|
+
grpc_closure* on_close_callback)
|
|
1912
|
+
: channelz::DataSource(http2::CreateChannelzSocketNode(
|
|
1913
|
+
endpoint.GetEventEngineEndpoint(), channel_args)),
|
|
1914
|
+
event_engine_(std::move(event_engine)),
|
|
1915
|
+
endpoint_(std::move(endpoint)),
|
|
1916
|
+
settings_(MakeRefCounted<SettingsPromiseManager>(
|
|
1917
|
+
kIsClient, std::move(on_receive_settings))),
|
|
1918
|
+
on_close_callback_(on_close_callback),
|
|
1919
|
+
should_reset_ping_clock_(false),
|
|
1920
|
+
read_context_(MaxNewStreamsPerRead(channel_args), endpoint_, kIsClient,
|
|
1921
|
+
GetMaxSecurityFrameSize(channel_args)),
|
|
1922
|
+
transport_write_context_(kIsClient),
|
|
1923
|
+
ping_manager_(std::nullopt),
|
|
1924
|
+
keepalive_manager_(std::nullopt),
|
|
1925
|
+
goaway_manager_(GoawayInterfaceImpl::Make(this)),
|
|
1926
|
+
memory_owner_(channel_args.GetObject<ResourceQuota>()
|
|
1927
|
+
->memory_quota()
|
|
1928
|
+
->CreateMemoryOwner()),
|
|
1929
|
+
flow_control_(
|
|
1930
|
+
/*peer_name=*/read_context_.peer_string().as_string_view(),
|
|
1931
|
+
channel_args.GetBool(GRPC_ARG_HTTP2_BDP_PROBE).value_or(true),
|
|
1932
|
+
&memory_owner_),
|
|
1933
|
+
security_frame_handler_(MakeRefCounted<SecurityFrameHandler>()),
|
|
1934
|
+
ztrace_collector_(std::make_shared<PromiseHttp2ZTraceCollector>()) {
|
|
1935
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport Constructor Begin";
|
|
1936
|
+
|
|
1937
|
+
// Initialize the general party and write party.
|
|
1938
|
+
RefCountedPtr<Arena> party_arena = SimpleArenaAllocator(0)->MakeArena();
|
|
1939
|
+
party_arena->SetContext<EventEngine>(event_engine_.get());
|
|
1940
|
+
general_party_ = Party::Make(std::move(party_arena));
|
|
1941
|
+
|
|
1942
|
+
InitLocalSettings(settings_->mutable_local(), /*is_client=*/kIsClient);
|
|
1943
|
+
TransportChannelArgs args;
|
|
1944
|
+
ReadChannelArgs(channel_args, args);
|
|
1945
|
+
|
|
1946
|
+
ping_manager_.emplace(channel_args, args.ping_timeout,
|
|
1947
|
+
PingSystemInterfaceImpl::Make(this), event_engine_);
|
|
1948
|
+
|
|
1949
|
+
// The keepalive loop is only spawned if the keepalive time is not infinity.
|
|
1950
|
+
keepalive_manager_.emplace(
|
|
1951
|
+
KeepAliveInterfaceImpl::Make(this),
|
|
1952
|
+
((args.keepalive_timeout < args.ping_timeout) ? args.keepalive_timeout
|
|
1953
|
+
: Duration::Infinity()),
|
|
1954
|
+
args.keepalive_time);
|
|
1955
|
+
|
|
1956
|
+
GRPC_DCHECK(ping_manager_.has_value());
|
|
1957
|
+
GRPC_DCHECK(keepalive_manager_.has_value());
|
|
1958
|
+
SourceConstructed();
|
|
1959
|
+
|
|
1960
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport Constructor End";
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
Http2ServerTransport::~Http2ServerTransport() {
|
|
1964
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport Destructor Begin";
|
|
1965
|
+
// GRPC_DCHECK(stream_list_.empty());
|
|
1966
|
+
// GRPC_DCHECK(general_party_ == nullptr);
|
|
1967
|
+
// memory_owner_.Reset();
|
|
1968
|
+
|
|
1969
|
+
// TODO(akshitpatel) : [PH2][P0][Close] : Remove call to
|
|
1970
|
+
// HandleTransportShutdown() from here and plumb CloseTransport() correctly.
|
|
1971
|
+
settings_->HandleTransportShutdown(event_engine_.get());
|
|
1972
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport Destructor End";
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
1976
|
+
// Transport Functions
|
|
1977
|
+
|
|
1978
|
+
void Http2ServerTransport::SetCallDestination(
|
|
1979
|
+
RefCountedPtr<UnstartedCallDestination> unstarted_call_destination) {
|
|
1980
|
+
// This is called once in the lifetime of the transport.
|
|
1981
|
+
GRPC_CHECK(call_destination_ == nullptr);
|
|
1982
|
+
GRPC_CHECK(unstarted_call_destination != nullptr);
|
|
1983
|
+
call_destination_ = std::move(unstarted_call_destination);
|
|
1984
|
+
InitializeAndSpawnTransportLoops();
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
void Http2ServerTransport::PerformOp(grpc_transport_op* op) {
|
|
1988
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport PerformOp Begin";
|
|
1989
|
+
bool did_stuff = false;
|
|
1990
|
+
if (op->start_connectivity_watch != nullptr) {
|
|
1991
|
+
StartConnectivityWatch(op->start_connectivity_watch_state,
|
|
1992
|
+
std::move(op->start_connectivity_watch));
|
|
1993
|
+
did_stuff = true;
|
|
1994
|
+
}
|
|
1995
|
+
if (op->stop_connectivity_watch != nullptr) {
|
|
1996
|
+
StopConnectivityWatch(op->stop_connectivity_watch);
|
|
1997
|
+
did_stuff = true;
|
|
1998
|
+
}
|
|
1999
|
+
if (!op->disconnect_with_error.ok()) {
|
|
2000
|
+
MaybeSpawnCloseTransport(Http2Status::Http2ConnectionError(
|
|
2001
|
+
AbslStatusCodeToErrorCode(op->disconnect_with_error.code()),
|
|
2002
|
+
std::string(op->disconnect_with_error.message())));
|
|
2003
|
+
did_stuff = true;
|
|
2004
|
+
}
|
|
2005
|
+
// We always consider this case as a graceful shutdown.
|
|
2006
|
+
if (!op->goaway_error.ok()) {
|
|
2007
|
+
GRPC_HTTP2_SERVER_DLOG << "GracefulGoaway triggered with error: "
|
|
2008
|
+
<< op->goaway_error;
|
|
2009
|
+
SpawnGracefulGoawayPromise(
|
|
2010
|
+
Slice::FromCopiedString(op->goaway_error.message()));
|
|
2011
|
+
did_stuff = true;
|
|
2012
|
+
}
|
|
2013
|
+
GRPC_DCHECK(did_stuff) << "Unimplemented transport perform op ";
|
|
2014
|
+
|
|
2015
|
+
ExecCtx::Run(DEBUG_LOCATION, op->on_consumed, absl::OkStatus());
|
|
2016
|
+
|
|
2017
|
+
// TODO(tjagtap) : [PH2][P2] :
|
|
2018
|
+
// Refer src/core/ext/transport/chttp2/transport/chttp2_transport.cc
|
|
2019
|
+
// perform_transport_op_locked
|
|
2020
|
+
// Maybe more operations needed to be implemented.
|
|
2021
|
+
// TODO(tjagtap) : [PH2][P2] : Consider either not using a transport level
|
|
2022
|
+
// lock, or making this run on the Transport party - whatever is better.
|
|
2023
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport PerformOp End";
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2026
|
+
void Http2ServerTransport::Orphan() {
|
|
2027
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::Orphan Begin";
|
|
2028
|
+
SourceDestructing();
|
|
2029
|
+
MaybeSpawnCloseTransport(
|
|
2030
|
+
ToHttpOkOrConnError(absl::UnavailableError("Orphaned")));
|
|
2031
|
+
Unref();
|
|
2032
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::Orphan End";
|
|
2033
|
+
}
|
|
2034
|
+
|
|
2035
|
+
void Http2ServerTransport::SpawnTransportLoops() {
|
|
2036
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::SpawnTransportLoops Begin";
|
|
2037
|
+
MaybeSpawnKeepaliveLoop();
|
|
2038
|
+
|
|
2039
|
+
// SpawnGuardedTransportParty(
|
|
2040
|
+
// "FlowControlPeriodicUpdateLoop",
|
|
2041
|
+
// UntilTransportClosed(FlowControlPeriodicUpdateLoop()));
|
|
2042
|
+
|
|
2043
|
+
if (!TriggerWriteCycleOrHandleError()) {
|
|
2044
|
+
return;
|
|
2045
|
+
}
|
|
2046
|
+
// For Client, write happens before read. So MultiplexerLoop is spawned first.
|
|
2047
|
+
// ReadLoop is spawned after the first write.
|
|
2048
|
+
// For Server, read happens before write. So ReadLoop is spawned first.
|
|
2049
|
+
SpawnGuardedTransportParty("ReadLoop", UntilTransportClosed(ReadLoop()));
|
|
2050
|
+
SpawnGuardedTransportParty("MultiplexerLoop",
|
|
2051
|
+
UntilTransportClosed(MultiplexerLoop()));
|
|
2052
|
+
|
|
2053
|
+
GRPC_HTTP2_SERVER_DLOG << "Http2ServerTransport::SpawnTransportLoops End";
|
|
2054
|
+
}
|
|
2055
|
+
|
|
2056
|
+
void Http2ServerTransport::InitializeAndSpawnTransportLoops() {
|
|
2057
|
+
SpawnGuardedTransportParty(
|
|
2058
|
+
"SpawnTransportLoops", [self = RefAsSubclass<Http2ServerTransport>()] {
|
|
2059
|
+
return Map(self->EndpointReadSlice(GRPC_CHTTP2_CLIENT_CONNECT_STRLEN),
|
|
2060
|
+
[self](absl::StatusOr<Slice> status) -> absl::Status {
|
|
2061
|
+
Http2Status result =
|
|
2062
|
+
ValidateIncomingConnectionPreface(status);
|
|
2063
|
+
if (!result.IsOk()) {
|
|
2064
|
+
return self->HandleError(nullptr, std::move(result));
|
|
2065
|
+
}
|
|
2066
|
+
self->SpawnTransportLoops();
|
|
2067
|
+
return absl::OkStatus();
|
|
2068
|
+
});
|
|
2069
|
+
});
|
|
2070
|
+
}
|
|
2071
|
+
|
|
2072
|
+
} // namespace http2
|
|
2073
|
+
} // namespace grpc_core
|