grpc 1.83.0 → 1.84.0.pre1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Makefile +21 -17
- data/include/grpc/credentials.h +10 -0
- data/include/grpc/grpc_security_constants.h +2 -0
- data/include/grpc/impl/channel_arg_names.h +9 -0
- data/src/core/call/call_filters.h +4 -2
- data/src/core/call/client_call.cc +20 -8
- data/src/core/call/client_call.h +4 -0
- data/src/core/call/interception_chain.cc +2 -0
- data/src/core/call/interception_chain.h +14 -1
- data/src/core/call/metadata.cc +1 -3
- data/src/core/call/metadata_batch.h +13 -5
- data/src/core/call/server_call.cc +31 -14
- data/src/core/call/server_call.h +4 -0
- data/src/core/channelz/text_encode.cc +9 -4
- data/src/core/channelz/v2tov1/convert.cc +2 -2
- data/src/core/client_channel/backup_poller.cc +1 -2
- data/src/core/client_channel/client_channel.cc +6 -33
- data/src/core/client_channel/client_channel_filter.cc +22 -55
- data/src/core/client_channel/client_channel_filter.h +2 -2
- data/src/core/client_channel/client_channel_service_config.cc +3 -19
- data/src/core/client_channel/direct_channel.cc +7 -1
- data/src/core/client_channel/direct_channel.h +2 -2
- data/src/core/client_channel/load_balanced_call_destination.cc +5 -3
- data/src/core/client_channel/retry_filter_legacy_call_data.cc +5 -12
- data/src/core/client_channel/subchannel.cc +310 -1058
- data/src/core/client_channel/subchannel.h +44 -329
- data/src/core/client_channel/subchannel_metrics.cc +48 -0
- data/src/core/client_channel/subchannel_metrics.h +60 -0
- data/src/core/credentials/call/external/file_external_account_credentials.cc +1 -1
- data/src/core/credentials/call/external/url_external_account_credentials.cc +2 -3
- data/src/core/credentials/call/gcp_service_account_identity/gcp_service_account_identity_credentials.cc +8 -24
- data/src/core/credentials/call/gcp_service_account_identity/gcp_service_account_identity_credentials.h +3 -6
- data/src/core/credentials/call/gdch_service_account/gdch_service_account_credentials.cc +525 -0
- data/src/core/credentials/call/gdch_service_account/gdch_service_account_credentials.h +138 -0
- data/src/core/credentials/call/json_util.h +1 -0
- data/src/core/credentials/call/jwt/json_token.cc +10 -2
- data/src/core/credentials/call/jwt/jwt_verifier.cc +15 -1
- data/src/core/credentials/call/jwt_token_file/jwt_token_file_call_credentials.cc +1 -1
- data/src/core/credentials/call/oauth2/oauth2_credentials.cc +42 -79
- data/src/core/credentials/call/oauth2/oauth2_credentials.h +2 -5
- data/src/core/credentials/call/token_fetcher/token_fetcher_credentials.cc +52 -31
- data/src/core/credentials/call/token_fetcher/token_fetcher_credentials.h +21 -8
- data/src/core/credentials/transport/google_default/google_default_credentials.cc +3 -4
- data/src/core/credentials/transport/ssl/ssl_credentials.cc +59 -72
- data/src/core/credentials/transport/ssl/ssl_credentials.h +9 -8
- data/src/core/credentials/transport/ssl/ssl_security_connector.cc +12 -6
- data/src/core/credentials/transport/ssl/ssl_security_connector.h +4 -4
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.cc +29 -18
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.h +9 -6
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.cc +45 -56
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.h +5 -4
- data/src/core/credentials/transport/tls/grpc_tls_certificate_selector.h +26 -0
- data/src/core/credentials/transport/tls/grpc_tls_crl_provider.cc +1 -1
- data/src/core/credentials/transport/tls/load_system_roots.h +2 -6
- data/src/core/credentials/transport/tls/load_system_roots_fallback.cc +2 -4
- data/src/core/credentials/transport/tls/load_system_roots_supported.cc +13 -15
- data/src/core/credentials/transport/tls/load_system_roots_supported.h +3 -2
- data/src/core/credentials/transport/tls/load_system_roots_windows.cc +5 -8
- data/src/core/credentials/transport/tls/spiffe_utils.cc +1 -1
- data/src/core/credentials/transport/tls/ssl_utils.cc +39 -28
- data/src/core/credentials/transport/tls/ssl_utils.h +12 -49
- data/src/core/credentials/transport/tls/tls_security_connector.cc +48 -33
- data/src/core/credentials/transport/tls/tls_security_connector.h +31 -10
- data/src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc +15 -11
- data/src/core/ext/filters/http/http_filters_plugin.cc +20 -9
- data/src/core/ext/filters/http/message_compress/compression_filter.cc +25 -32
- data/src/core/ext/filters/http/message_compress/compression_filter.h +0 -1
- data/src/core/ext/filters/rbac/rbac_filter.cc +43 -21
- data/src/core/ext/filters/rbac/rbac_filter.h +21 -3
- data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +2 -2
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +1 -1
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +6 -20
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +80 -70
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.h +78 -4
- data/src/core/ext/transport/chttp2/transport/frame.h +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +33 -2
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +55 -23
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +1 -0
- data/src/core/ext/transport/chttp2/transport/goaway.h +7 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +5 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +3 -1
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +141 -130
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +22 -22
- data/src/core/ext/transport/chttp2/transport/http2_server_transport.cc +402 -269
- data/src/core/ext/transport/chttp2/transport/http2_server_transport.h +80 -49
- data/src/core/ext/transport/chttp2/transport/http2_settings_promises.h +1 -2
- data/src/core/ext/transport/chttp2/transport/http2_status.h +38 -37
- data/src/core/ext/transport/chttp2/transport/http2_transport.cc +178 -5
- data/src/core/ext/transport/chttp2/transport/http2_transport.h +345 -5
- data/src/core/ext/transport/chttp2/transport/internal.h +6 -0
- data/src/core/ext/transport/chttp2/transport/parsing.cc +13 -5
- data/src/core/ext/transport/chttp2/transport/ping_promise.cc +3 -2
- data/src/core/ext/transport/chttp2/transport/ping_promise.h +25 -5
- data/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc +3 -4
- data/src/core/ext/transport/chttp2/transport/read_context.h +30 -3
- data/src/core/ext/transport/chttp2/transport/stream.h +65 -23
- data/src/core/ext/transport/chttp2/transport/writing.cc +0 -3
- data/src/core/ext/transport/inproc/inproc_transport.cc +1 -5
- data/src/core/ext/transport/inproc/legacy_inproc_transport.cc +4 -17
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upb.h +1912 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upb_minitable.c +300 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upb_minitable.h +37 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/processing_mode.upb.h +187 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/processing_mode.upb_minitable.c +64 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/processing_mode.upb_minitable.h +31 -0
- data/src/core/ext/upb-gen/envoy/service/ext_proc/v3/external_processor.upb.h +2362 -0
- data/src/core/ext/upb-gen/envoy/service/ext_proc/v3/external_processor.upb_minitable.c +556 -0
- data/src/core/ext/upb-gen/envoy/service/ext_proc/v3/external_processor.upb_minitable.h +47 -0
- data/src/core/ext/upb-gen/{src/proto/grpc/channelz → grpc/channelz/v1}/channelz.upb.h +5 -5
- data/src/core/ext/upb-gen/{src/proto/grpc/channelz → grpc/channelz/v1}/channelz.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/{src/proto/grpc/channelz → grpc/channelz/v1}/channelz.upb_minitable.h +5 -5
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upbdefs.c +453 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upbdefs.h +67 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/ext_proc/v3/processing_mode.upbdefs.c +142 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/ext_proc/v3/processing_mode.upbdefs.h +37 -0
- data/src/core/ext/upbdefs-gen/grpc/channelz/v1/channelz.upbdefs.c +715 -0
- data/src/core/ext/upbdefs-gen/{src/proto/grpc/channelz → grpc/channelz/v1}/channelz.upbdefs.h +44 -44
- data/src/core/filter/auth/server_auth_filter.cc +2 -3
- data/src/core/filter/composite/composite_filter.cc +45 -33
- data/src/core/filter/composite/composite_filter.h +5 -4
- data/src/core/filter/ext_proc/ext_proc_filter.cc +224 -0
- data/src/core/filter/ext_proc/ext_proc_filter.h +155 -0
- data/src/core/filter/ext_proc/ext_proc_messages.cc +701 -0
- data/src/core/filter/ext_proc/ext_proc_messages.h +297 -0
- data/src/core/filter/filter_args.h +13 -2
- data/src/core/handshaker/http_connect/http_proxy_mapper.cc +30 -3
- data/src/core/handshaker/security/security_handshaker.cc +9 -6
- data/src/core/lib/channel/channel_stack.cc +3 -0
- data/src/core/lib/channel/channel_stack.h +2 -0
- data/src/core/lib/channel/channel_stack_builder_impl.cc +1 -2
- data/src/core/lib/channel/promise_based_filter.cc +132 -20
- data/src/core/lib/channel/promise_based_filter.h +42 -12
- data/src/core/lib/compression/compression_internal.cc +4 -5
- data/src/core/lib/compression/message_compress.cc +132 -97
- data/src/core/lib/compression/message_compress.h +24 -0
- data/src/core/lib/debug/trace_flags.cc +8 -0
- data/src/core/lib/debug/trace_flags.h +3 -0
- data/src/core/lib/event_engine/ares_resolver.cc +54 -50
- data/src/core/lib/event_engine/ares_resolver.h +3 -2
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +3 -3
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +4 -10
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +74 -33
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +4 -4
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +6 -2
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +3 -0
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +3 -0
- data/src/core/lib/event_engine/windows/windows_endpoint.cc +1 -3
- data/src/core/lib/experiments/experiments.cc +81 -102
- data/src/core/lib/experiments/experiments.h +57 -56
- data/src/core/lib/iomgr/cfstream_handle.cc +2 -6
- data/src/core/lib/iomgr/endpoint_cfstream.cc +3 -10
- data/src/core/lib/iomgr/error.cc +2 -6
- data/src/core/lib/iomgr/error_cfstream.cc +1 -1
- data/src/core/lib/iomgr/ev_poll_posix.cc +5 -9
- data/src/core/lib/iomgr/event_engine_shims/closure.cc +1 -1
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +1 -2
- data/src/core/lib/iomgr/event_engine_shims/tcp_client.cc +1 -2
- data/src/core/lib/iomgr/iomgr_posix.cc +0 -4
- data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +0 -4
- data/src/core/lib/iomgr/iomgr_windows.cc +0 -4
- data/src/core/lib/iomgr/socket_factory_posix.h +1 -1
- data/src/core/lib/iomgr/socket_utils_posix.cc +3 -0
- data/src/core/lib/iomgr/socket_utils_posix.h +3 -0
- data/src/core/lib/iomgr/systemd_utils.cc +0 -1
- data/src/core/lib/iomgr/tcp_client.h +1 -1
- data/src/core/lib/iomgr/tcp_posix.cc +23 -15
- data/src/core/lib/iomgr/tcp_server.h +1 -1
- data/src/core/lib/iomgr/tcp_server_posix.cc +2 -3
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +0 -1
- data/src/core/lib/iomgr/tcp_server_windows.cc +0 -1
- data/src/core/lib/iomgr/tcp_windows.cc +5 -10
- data/src/core/lib/iomgr/unix_sockets_posix.cc +2 -4
- data/src/core/lib/iomgr/unix_sockets_posix.h +3 -1
- data/src/core/lib/iomgr/vsock.h +3 -1
- data/src/core/lib/resource_quota/memory_quota.cc +1 -1
- data/src/core/lib/security/authorization/rbac_policy.cc +139 -56
- data/src/core/lib/security/authorization/rbac_policy.h +21 -3
- data/src/core/lib/surface/call.cc +3 -9
- data/src/core/lib/surface/call_utils.h +113 -0
- data/src/core/lib/surface/channel_create.cc +1 -1
- data/src/core/lib/surface/channel_create.h +0 -2
- data/src/core/lib/surface/channel_init.cc +77 -38
- data/src/core/lib/surface/channel_init.h +30 -16
- data/src/core/lib/surface/filter_stack_call.cc +5 -10
- data/src/core/lib/surface/init.cc +13 -27
- data/src/core/lib/surface/legacy_channel.cc +3 -1
- data/src/core/lib/surface/version.cc +1 -1
- data/src/core/lib/transport/error_utils.cc +0 -27
- data/src/core/lib/transport/error_utils.h +0 -16
- data/src/core/lib/transport/transport.h +7 -5
- data/src/core/load_balancing/pick_first/pick_first.cc +2 -0
- data/src/core/load_balancing/rls/rls.cc +28 -11
- data/src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc +33 -42
- data/src/core/load_balancing/weighted_round_robin/weighted_round_robin.h +0 -2
- data/src/core/load_balancing/xds/cds.cc +3 -1
- data/src/core/load_balancing/xds/xds_cluster_impl.cc +0 -1
- data/src/core/mitigation_engine/mitigation.h +14 -5
- data/src/core/mitigation_engine/mitigation_engine.h +7 -3
- data/src/core/mitigation_engine/mitigation_provider.h +2 -1
- data/src/core/plugin_registry/grpc_plugin_registry.cc +39 -8
- data/src/core/resolver/dns/{event_engine/event_engine_client_channel_resolver.cc → dns_resolver.cc} +42 -41
- data/src/core/resolver/dns/{event_engine/event_engine_client_channel_resolver.h → dns_resolver.h} +8 -5
- data/src/core/resolver/dns/{event_engine/service_config_helper.cc → service_config_helper.cc} +1 -1
- data/src/core/resolver/dns/{event_engine/service_config_helper.h → service_config_helper.h} +3 -3
- data/src/core/resolver/endpoint_addresses.h +3 -0
- data/src/core/resolver/google_c2p/google_c2p_resolver.cc +2 -1
- data/src/core/resolver/xds/xds_resolver.cc +35 -9
- data/src/core/server/server.cc +2 -6
- data/src/core/server/server_config_selector.h +18 -3
- data/src/core/server/server_config_selector_filter.cc +178 -91
- data/src/core/server/server_config_selector_filter.h +58 -3
- data/src/core/server/xds_server_config_fetcher.cc +196 -129
- data/src/core/server/xds_server_config_fetcher.h +49 -0
- data/src/core/server/xds_server_config_fetcher_legacy.cc +41 -37
- data/src/core/telemetry/histogram.h +94 -14
- data/src/core/telemetry/instrument.cc +179 -74
- data/src/core/telemetry/instrument.h +78 -30
- data/src/core/telemetry/metrics.h +5 -0
- data/src/core/{resolver/dns/dns_resolver_plugin.h → telemetry/telemetry_label.h} +12 -8
- data/src/core/tsi/alts/crypt/aes_gcm.cc +10 -13
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +2 -2
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +3 -1
- data/src/core/tsi/ssl_telemetry_utils.cc +216 -259
- data/src/core/tsi/ssl_telemetry_utils.h +12 -2
- data/src/core/tsi/ssl_transport_security.cc +238 -80
- data/src/core/tsi/ssl_transport_security.h +63 -33
- data/src/core/tsi/tls_telemetry.cc +31 -0
- data/src/core/tsi/tls_telemetry.h +47 -0
- data/src/core/tsi/transport_security.cc +2 -2
- data/src/core/tsi/transport_security.h +1 -1
- data/src/core/tsi/transport_security_interface.h +1 -1
- data/src/core/{resolver/dns/native/dns_resolver.h → util/address_sorting_init.cc} +21 -8
- data/src/core/{resolver/dns/c_ares/grpc_ares_wrapper_posix.cc → util/address_sorting_init.h} +7 -8
- data/src/core/util/http_client/httpcli.cc +16 -53
- data/src/core/util/http_client/httpcli.h +0 -7
- data/src/core/util/http_client/httpcli_security_connector.cc +13 -8
- data/src/core/util/linux/cpu.cc +1 -1
- data/src/core/util/load_file.cc +3 -9
- data/src/core/util/load_file.h +3 -4
- data/src/core/util/matchers.h +8 -0
- data/src/core/util/posix/cpu.cc +1 -1
- data/src/core/util/status_helper.cc +0 -20
- data/src/core/util/status_helper.h +3 -14
- data/src/core/xds/grpc/xds_audit_logger_registry.cc +51 -31
- data/src/core/xds/grpc/xds_audit_logger_registry.h +17 -3
- data/src/core/xds/grpc/xds_bootstrap_grpc.cc +2 -10
- data/src/core/xds/grpc/xds_bootstrap_grpc.h +8 -6
- data/src/core/xds/grpc/xds_bootstrap_grpc_builder.cc +488 -0
- data/src/core/xds/grpc/xds_bootstrap_grpc_builder.h +97 -0
- data/src/core/xds/grpc/xds_certificate_provider.cc +7 -7
- data/src/core/xds/grpc/xds_client_grpc.cc +4 -8
- data/src/core/xds/grpc/xds_client_grpc.h +0 -4
- data/src/core/xds/grpc/xds_cluster.h +1 -0
- data/src/core/xds/grpc/xds_cluster_parser.cc +1 -5
- data/src/core/xds/grpc/xds_cluster_parser.h +0 -2
- data/src/core/xds/grpc/xds_cluster_specifier_plugin.cc +0 -2
- data/src/core/xds/grpc/xds_cluster_specifier_plugin.h +0 -2
- data/src/core/xds/grpc/xds_common_types.cc +0 -91
- data/src/core/xds/grpc/xds_common_types.h +1 -47
- data/src/core/xds/grpc/xds_common_types_parser.cc +84 -378
- data/src/core/xds/grpc/xds_common_types_parser.h +9 -11
- data/src/core/xds/grpc/xds_endpoint_parser.cc +0 -2
- data/src/core/xds/grpc/xds_grpc_service_parser.cc +177 -0
- data/src/core/{resolver/dns/c_ares/dns_resolver_ares.h → xds/grpc/xds_grpc_service_parser.h} +14 -9
- data/src/core/xds/grpc/xds_http_composite_filter.cc +26 -21
- data/src/core/xds/grpc/xds_http_composite_filter.h +4 -3
- data/src/core/xds/grpc/xds_http_ext_proc_filter.cc +418 -0
- data/src/core/xds/grpc/xds_http_ext_proc_filter.h +89 -0
- data/src/core/xds/grpc/xds_http_fault_filter.cc +9 -12
- data/src/core/xds/grpc/xds_http_fault_filter.h +1 -4
- data/src/core/xds/grpc/xds_http_filter.cc +2 -1
- data/src/core/xds/grpc/xds_http_filter.h +6 -5
- data/src/core/xds/grpc/xds_http_filter_registry.cc +10 -127
- data/src/core/xds/grpc/xds_http_filter_registry.h +7 -59
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.cc +13 -14
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.h +3 -2
- data/src/core/xds/grpc/xds_http_rbac_filter.cc +403 -25
- data/src/core/xds/grpc/xds_http_rbac_filter.h +1 -3
- data/src/core/xds/grpc/xds_http_stateful_session_filter.cc +8 -13
- data/src/core/xds/grpc/xds_http_stateful_session_filter.h +1 -4
- data/src/core/xds/grpc/xds_lb_policy_registry.cc +0 -292
- data/src/core/xds/grpc/xds_lb_policy_registry.h +7 -3
- data/src/core/xds/grpc/xds_listener.cc +2 -0
- data/src/core/xds/grpc/xds_listener.h +5 -0
- data/src/core/xds/grpc/xds_listener_parser.cc +16 -11
- data/src/core/xds/grpc/xds_matcher_parse.h +3 -1
- data/src/core/xds/grpc/xds_metadata_parser.cc +6 -1
- data/src/core/xds/grpc/xds_metadata_parser.h +2 -0
- data/src/core/xds/grpc/xds_route_config.cc +2 -0
- data/src/core/xds/grpc/xds_route_config.h +3 -1
- data/src/core/xds/grpc/xds_route_config_parser.cc +13 -79
- data/src/core/xds/grpc/xds_route_config_parser.h +0 -3
- data/src/core/xds/grpc/xds_routing.cc +116 -69
- data/src/core/xds/grpc/xds_routing.h +19 -8
- data/src/core/xds/grpc/xds_tls_context.cc +117 -0
- data/src/core/xds/grpc/xds_tls_context.h +76 -0
- data/src/core/xds/grpc/xds_tls_context_parser.cc +275 -0
- data/src/core/xds/grpc/xds_tls_context_parser.h +35 -0
- data/src/core/xds/grpc/xds_transport_grpc.cc +41 -38
- data/src/core/xds/grpc/xds_transport_grpc.h +4 -2
- data/src/ruby/ext/grpc/rb_call.c +26 -15
- data/src/ruby/ext/grpc/rb_completion_queue.c +6 -5
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +2 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +3 -0
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/test/client.rb +5 -4
- data/src/ruby/spec/call_spec.rb +14 -0
- data/src/ruby/spec/generic/server_interceptors_spec.rb +3 -6
- metadata +50 -35
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/channelz.upbdefs.c +0 -716
- data/src/core/lib/iomgr/resolve_address.cc +0 -59
- data/src/core/lib/iomgr/resolve_address.h +0 -125
- data/src/core/lib/iomgr/resolve_address_impl.h +0 -58
- data/src/core/lib/iomgr/resolve_address_posix.cc +0 -184
- data/src/core/lib/iomgr/resolve_address_posix.h +0 -78
- data/src/core/lib/iomgr/resolve_address_windows.cc +0 -169
- data/src/core/lib/iomgr/resolve_address_windows.h +0 -76
- data/src/core/resolver/dns/c_ares/dns_resolver_ares.cc +0 -781
- data/src/core/resolver/dns/c_ares/grpc_ares_ev_driver.h +0 -93
- data/src/core/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +0 -203
- data/src/core/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +0 -838
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper.cc +0 -1237
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper.h +0 -130
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +0 -35
- data/src/core/resolver/dns/dns_resolver_plugin.cc +0 -64
- data/src/core/resolver/dns/native/dns_resolver.cc +0 -173
- data/src/core/util/json/json_util.cc +0 -101
- data/src/core/util/json/json_util.h +0 -163
|
@@ -44,21 +44,29 @@ namespace grpc_core {
|
|
|
44
44
|
absl::Status RbacFilter::Call::OnClientInitialMetadata(ClientMetadata& md,
|
|
45
45
|
RbacFilter* filter) {
|
|
46
46
|
GRPC_LATENT_SEE_SCOPE("RbacFilter::Call::OnClientInitialMetadata");
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
47
|
+
if (!IsXdsServerFilterChainPerRouteEnabled()) {
|
|
48
|
+
// Fetch and apply the rbac policy from the service config.
|
|
49
|
+
auto* service_config_call_data = GetContext<ServiceConfigCallData>();
|
|
50
|
+
auto* method_params = static_cast<RbacMethodParsedConfig*>(
|
|
51
|
+
service_config_call_data->GetMethodParsedConfig(
|
|
52
|
+
filter->service_config_parser_index_));
|
|
53
|
+
if (method_params == nullptr) {
|
|
54
|
+
return absl::PermissionDeniedError("No RBAC policy found.");
|
|
55
|
+
} else {
|
|
56
|
+
auto* authorization_engine =
|
|
57
|
+
method_params->authorization_engine(filter->index_);
|
|
58
|
+
if (authorization_engine
|
|
59
|
+
->Evaluate(EvaluateArgs(&md, &filter->per_channel_evaluate_args_))
|
|
60
|
+
.type == AuthorizationEngine::Decision::Type::kDeny) {
|
|
61
|
+
return absl::PermissionDeniedError("Unauthorized RPC rejected");
|
|
62
|
+
}
|
|
61
63
|
}
|
|
64
|
+
return absl::OkStatus();
|
|
65
|
+
}
|
|
66
|
+
auto decision = filter->authorization_engine_.Evaluate(
|
|
67
|
+
EvaluateArgs(&md, &filter->per_channel_evaluate_args_));
|
|
68
|
+
if (decision.type == AuthorizationEngine::Decision::Type::kDeny) {
|
|
69
|
+
return absl::PermissionDeniedError("Unauthorized RPC rejected");
|
|
62
70
|
}
|
|
63
71
|
return absl::OkStatus();
|
|
64
72
|
}
|
|
@@ -66,12 +74,6 @@ absl::Status RbacFilter::Call::OnClientInitialMetadata(ClientMetadata& md,
|
|
|
66
74
|
const grpc_channel_filter RbacFilter::kFilterVtable =
|
|
67
75
|
MakePromiseBasedFilter<RbacFilter, FilterEndpoint::kServer>();
|
|
68
76
|
|
|
69
|
-
RbacFilter::RbacFilter(size_t index,
|
|
70
|
-
EvaluateArgs::PerChannelArgs per_channel_evaluate_args)
|
|
71
|
-
: index_(index),
|
|
72
|
-
service_config_parser_index_(RbacServiceConfigParser::ParserIndex()),
|
|
73
|
-
per_channel_evaluate_args_(std::move(per_channel_evaluate_args)) {}
|
|
74
|
-
|
|
75
77
|
absl::StatusOr<std::unique_ptr<RbacFilter>> RbacFilter::Create(
|
|
76
78
|
const ChannelArgs& args, ChannelFilter::Args filter_args) {
|
|
77
79
|
auto* auth_context = args.GetObject<grpc_auth_context>();
|
|
@@ -84,11 +86,31 @@ absl::StatusOr<std::unique_ptr<RbacFilter>> RbacFilter::Create(
|
|
|
84
86
|
// side.
|
|
85
87
|
return GRPC_ERROR_CREATE("No transport configured");
|
|
86
88
|
}
|
|
89
|
+
if (!IsXdsServerFilterChainPerRouteEnabled()) {
|
|
90
|
+
return std::make_unique<RbacFilter>(
|
|
91
|
+
filter_args.instance_id(), Rbac(),
|
|
92
|
+
EvaluateArgs::PerChannelArgs(auth_context, args));
|
|
93
|
+
}
|
|
94
|
+
if (filter_args.config() == nullptr) {
|
|
95
|
+
return absl::InternalError("no config passed to RBAC filter");
|
|
96
|
+
}
|
|
97
|
+
if (filter_args.config()->type() != Config::Type()) {
|
|
98
|
+
return absl::InternalError(
|
|
99
|
+
absl::StrCat("wrong config type passed to RBAC filter: ",
|
|
100
|
+
filter_args.config()->type().name()));
|
|
101
|
+
}
|
|
87
102
|
return std::make_unique<RbacFilter>(
|
|
88
|
-
filter_args.
|
|
103
|
+
/*instance_id=*/0, DownCast<const Config&>(*filter_args.config()).rbac,
|
|
89
104
|
EvaluateArgs::PerChannelArgs(auth_context, args));
|
|
90
105
|
}
|
|
91
106
|
|
|
107
|
+
RbacFilter::RbacFilter(size_t index, const Rbac& rbac,
|
|
108
|
+
EvaluateArgs::PerChannelArgs per_channel_evaluate_args)
|
|
109
|
+
: index_(index),
|
|
110
|
+
service_config_parser_index_(RbacServiceConfigParser::ParserIndex()),
|
|
111
|
+
authorization_engine_(rbac),
|
|
112
|
+
per_channel_evaluate_args_(std::move(per_channel_evaluate_args)) {}
|
|
113
|
+
|
|
92
114
|
void RbacFilterRegister(CoreConfiguration::Builder* builder) {
|
|
93
115
|
RbacServiceConfigParser::Register(builder);
|
|
94
116
|
}
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
#include "src/core/lib/channel/promise_based_filter.h"
|
|
26
26
|
#include "src/core/lib/promise/arena_promise.h"
|
|
27
27
|
#include "src/core/lib/security/authorization/evaluate_args.h"
|
|
28
|
+
#include "src/core/lib/security/authorization/grpc_authorization_engine.h"
|
|
29
|
+
#include "src/core/lib/security/authorization/rbac_policy.h"
|
|
28
30
|
#include "src/core/lib/transport/transport.h"
|
|
29
31
|
#include "absl/status/statusor.h"
|
|
30
32
|
|
|
@@ -34,6 +36,20 @@ namespace grpc_core {
|
|
|
34
36
|
// HTTP RBAC filter. Also serves as the type for channel data for the filter.
|
|
35
37
|
class RbacFilter : public ImplementChannelFilter<RbacFilter> {
|
|
36
38
|
public:
|
|
39
|
+
struct Config final : public FilterConfig {
|
|
40
|
+
static UniqueTypeName Type() {
|
|
41
|
+
return GRPC_UNIQUE_TYPE_NAME_HERE("rbac_filter_config");
|
|
42
|
+
}
|
|
43
|
+
UniqueTypeName type() const override { return Type(); }
|
|
44
|
+
|
|
45
|
+
bool Equals(const FilterConfig& other) const override {
|
|
46
|
+
return rbac == DownCast<const Config&>(other).rbac;
|
|
47
|
+
}
|
|
48
|
+
std::string ToString() const override { return rbac.ToString(); }
|
|
49
|
+
|
|
50
|
+
Rbac rbac;
|
|
51
|
+
};
|
|
52
|
+
|
|
37
53
|
// This channel filter is intended to be used by connections on xDS enabled
|
|
38
54
|
// servers configured with RBAC. The RBAC filter fetches the RBAC policy from
|
|
39
55
|
// the method config of service config returned by the ServerConfigSelector,
|
|
@@ -45,7 +61,7 @@ class RbacFilter : public ImplementChannelFilter<RbacFilter> {
|
|
|
45
61
|
static absl::StatusOr<std::unique_ptr<RbacFilter>> Create(
|
|
46
62
|
const ChannelArgs& args, ChannelFilter::Args filter_args);
|
|
47
63
|
|
|
48
|
-
RbacFilter(size_t index,
|
|
64
|
+
RbacFilter(size_t index, const Rbac& rbac,
|
|
49
65
|
EvaluateArgs::PerChannelArgs per_channel_evaluate_args);
|
|
50
66
|
|
|
51
67
|
class Call {
|
|
@@ -64,10 +80,12 @@ class RbacFilter : public ImplementChannelFilter<RbacFilter> {
|
|
|
64
80
|
};
|
|
65
81
|
|
|
66
82
|
private:
|
|
67
|
-
//
|
|
83
|
+
// TODO(roth): Remove these fields as part of removing the
|
|
84
|
+
// xds_server_filter_chain_per_route experiment.
|
|
68
85
|
size_t index_;
|
|
69
|
-
// Assigned index for service config data from the parser.
|
|
70
86
|
const size_t service_config_parser_index_;
|
|
87
|
+
|
|
88
|
+
GrpcAuthorizationEngine authorization_engine_;
|
|
71
89
|
// Per channel args used for authorization.
|
|
72
90
|
EvaluateArgs::PerChannelArgs per_channel_evaluate_args_;
|
|
73
91
|
};
|
|
@@ -564,7 +564,7 @@ void RbacConfig::RbacPolicy::Rules::Policy::Permission::JsonPostLoad(
|
|
|
564
564
|
/*required=*/false);
|
|
565
565
|
if (not_rule.has_value()) {
|
|
566
566
|
permission = std::make_unique<Rbac::Permission>(
|
|
567
|
-
Rbac::Permission::MakeNotPermission(std::move(
|
|
567
|
+
Rbac::Permission::MakeNotPermission(std::move(not_rule->permission)));
|
|
568
568
|
return;
|
|
569
569
|
}
|
|
570
570
|
if (errors->size() == original_error_size) {
|
|
@@ -719,7 +719,7 @@ void RbacConfig::RbacPolicy::Rules::Policy::Principal::JsonPostLoad(
|
|
|
719
719
|
/*required=*/false);
|
|
720
720
|
if (not_rule.has_value()) {
|
|
721
721
|
principal = std::make_unique<Rbac::Principal>(
|
|
722
|
-
Rbac::Principal::MakeNotPrincipal(std::move(
|
|
722
|
+
Rbac::Principal::MakeNotPrincipal(std::move(not_rule->principal)));
|
|
723
723
|
return;
|
|
724
724
|
}
|
|
725
725
|
if (errors->size() == original_error_size) {
|
|
@@ -209,7 +209,7 @@ void Chttp2Connector::OnHandshakeDone(absl::StatusOr<HandshakerArgs*> result) {
|
|
|
209
209
|
} else {
|
|
210
210
|
GRPC_HTTP2_CONNECTOR_DLOG
|
|
211
211
|
<< "Chttp2Connector::OnHandshakeDone creating PH2 transport";
|
|
212
|
-
// TODO(tjagtap) : [PH2][
|
|
212
|
+
// TODO(tjagtap) : [PH2][P2] : Validate this code block thoroughly once
|
|
213
213
|
// the ping pong test is in place.
|
|
214
214
|
std::unique_ptr<grpc_event_engine::experimental::EventEngine::Endpoint>
|
|
215
215
|
event_engine_endpoint = grpc_event_engine::experimental::
|
|
@@ -65,8 +65,6 @@
|
|
|
65
65
|
#include "src/core/lib/iomgr/event_engine_shims/endpoint.h"
|
|
66
66
|
#include "src/core/lib/iomgr/iomgr_fwd.h"
|
|
67
67
|
#include "src/core/lib/iomgr/pollset_set.h"
|
|
68
|
-
#include "src/core/lib/iomgr/resolve_address.h"
|
|
69
|
-
#include "src/core/lib/iomgr/resolved_address.h"
|
|
70
68
|
#include "src/core/lib/iomgr/tcp_server.h"
|
|
71
69
|
#include "src/core/lib/iomgr/unix_sockets_posix.h"
|
|
72
70
|
#include "src/core/lib/iomgr/vsock.h"
|
|
@@ -744,24 +742,12 @@ absl::StatusOr<int> Chttp2ServerAddPort(Server* server, const char* addr,
|
|
|
744
742
|
resolved = grpc_resolve_vsock_address(parsed_addr_unprefixed);
|
|
745
743
|
GRPC_RETURN_IF_ERROR(resolved.status());
|
|
746
744
|
} else {
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
ee_resolver->get(), parsed_addr, "https");
|
|
754
|
-
} else {
|
|
755
|
-
// TODO(yijiem): Remove this after event_engine_dns_non_client_channel
|
|
756
|
-
// is fully enabled.
|
|
757
|
-
absl::StatusOr<std::vector<grpc_resolved_address>> iomgr_results =
|
|
758
|
-
GetDNSResolver()->LookupHostnameBlocking(parsed_addr, "https");
|
|
759
|
-
GRPC_RETURN_IF_ERROR(iomgr_results.status());
|
|
760
|
-
for (const auto& addr : *iomgr_results) {
|
|
761
|
-
results->push_back(
|
|
762
|
-
grpc_event_engine::experimental::CreateResolvedAddress(addr));
|
|
763
|
-
}
|
|
764
|
-
}
|
|
745
|
+
absl::StatusOr<std::unique_ptr<EventEngine::DNSResolver>> ee_resolver =
|
|
746
|
+
args.GetObjectRef<EventEngine>()->GetDNSResolver(
|
|
747
|
+
EventEngine::DNSResolver::ResolverOptions());
|
|
748
|
+
GRPC_RETURN_IF_ERROR(ee_resolver.status());
|
|
749
|
+
results = grpc_event_engine::experimental::LookupHostnameBlocking(
|
|
750
|
+
ee_resolver->get(), parsed_addr, "https");
|
|
765
751
|
}
|
|
766
752
|
if (resolved.ok()) {
|
|
767
753
|
for (const auto& addr : *resolved) {
|
|
@@ -106,6 +106,7 @@
|
|
|
106
106
|
#include "src/core/telemetry/stats_data.h"
|
|
107
107
|
#include "src/core/telemetry/tcp_tracer.h"
|
|
108
108
|
#include "src/core/transport/auth_context.h"
|
|
109
|
+
#include "src/core/transport/message_size_service_config.h"
|
|
109
110
|
#include "src/core/util/bitset.h"
|
|
110
111
|
#include "src/core/util/crash.h"
|
|
111
112
|
#include "src/core/util/debug_location.h"
|
|
@@ -697,13 +698,13 @@ void grpc_chttp2_transport::WriteSecurityFrameLocked(
|
|
|
697
698
|
if (data == nullptr) {
|
|
698
699
|
return;
|
|
699
700
|
}
|
|
701
|
+
if (!closed_with_error.ok()) {
|
|
702
|
+
return;
|
|
703
|
+
}
|
|
700
704
|
if (!settings.peer().allow_security_frame()) {
|
|
701
705
|
close_transport_locked(
|
|
702
|
-
this,
|
|
703
|
-
|
|
704
|
-
GRPC_ERROR_CREATE("Unexpected SECURITY frame scheduled for write"),
|
|
705
|
-
grpc_core::StatusIntProperty::kRpcStatus,
|
|
706
|
-
GRPC_STATUS_FAILED_PRECONDITION));
|
|
706
|
+
this, absl::FailedPreconditionError(
|
|
707
|
+
"Unexpected SECURITY frame scheduled for write"));
|
|
707
708
|
return;
|
|
708
709
|
}
|
|
709
710
|
grpc_core::SliceBuffer security_frame;
|
|
@@ -816,6 +817,7 @@ grpc_chttp2_transport::grpc_chttp2_transport(
|
|
|
816
817
|
Ref(), &init_keepalive_ping_locked),
|
|
817
818
|
absl::OkStatus());
|
|
818
819
|
|
|
820
|
+
// TODO(tjagtap) : [PH2][P0] : Do this for PH2.
|
|
819
821
|
if (flow_control.bdp_probe()) {
|
|
820
822
|
bdp_ping_blocked = true;
|
|
821
823
|
grpc_chttp2_act_on_flowctl_action(flow_control.PeriodicUpdate(), this,
|
|
@@ -859,6 +861,9 @@ grpc_chttp2_transport::grpc_chttp2_transport(
|
|
|
859
861
|
epte->SetSocketNode(channelz_socket);
|
|
860
862
|
}
|
|
861
863
|
}
|
|
864
|
+
|
|
865
|
+
max_recv_message_length =
|
|
866
|
+
grpc_core::GetMaxRecvSizeFromChannelArgs(channel_args);
|
|
862
867
|
}
|
|
863
868
|
|
|
864
869
|
static void destroy_transport_locked(void* tp, grpc_error_handle /*error*/) {
|
|
@@ -879,11 +884,14 @@ static void close_transport_locked(grpc_chttp2_transport* t,
|
|
|
879
884
|
grpc_error_handle error) {
|
|
880
885
|
end_all_the_calls(t, error);
|
|
881
886
|
cancel_pings(t, error);
|
|
887
|
+
if (t->transport_framing_endpoint_extension != nullptr) {
|
|
888
|
+
t->transport_framing_endpoint_extension->SetSendFrameCallback(nullptr);
|
|
889
|
+
t->transport_framing_endpoint_extension = nullptr;
|
|
890
|
+
}
|
|
882
891
|
if (t->closed_with_error.ok()) {
|
|
883
|
-
if (
|
|
892
|
+
if (absl::IsUnknown(error)) {
|
|
884
893
|
error =
|
|
885
|
-
|
|
886
|
-
GRPC_STATUS_UNAVAILABLE);
|
|
894
|
+
grpc_core::ReplaceStatusCode(error, absl::StatusCode::kUnavailable);
|
|
887
895
|
}
|
|
888
896
|
if (t->write_state != GRPC_CHTTP2_WRITE_STATE_IDLE) {
|
|
889
897
|
if (t->close_transport_on_writes_finished.ok()) {
|
|
@@ -1376,13 +1384,12 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
|
|
|
1376
1384
|
uint32_t goaway_error,
|
|
1377
1385
|
uint32_t last_stream_id,
|
|
1378
1386
|
absl::string_view goaway_text) {
|
|
1379
|
-
t->goaway_error =
|
|
1387
|
+
t->goaway_error =
|
|
1380
1388
|
grpc_error_set_int(absl::UnavailableError(absl::StrFormat(
|
|
1381
1389
|
"GOAWAY received; Error code: %u; Debug Text: %s",
|
|
1382
1390
|
goaway_error, goaway_text)),
|
|
1383
1391
|
grpc_core::StatusIntProperty::kHttp2Error,
|
|
1384
|
-
static_cast<intptr_t>(goaway_error))
|
|
1385
|
-
grpc_core::StatusIntProperty::kRpcStatus, GRPC_STATUS_UNAVAILABLE);
|
|
1392
|
+
static_cast<intptr_t>(goaway_error));
|
|
1386
1393
|
|
|
1387
1394
|
GRPC_TRACE_LOG(http, INFO)
|
|
1388
1395
|
<< "transport " << t << " got goaway with last stream id "
|
|
@@ -1410,7 +1417,7 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
|
|
|
1410
1417
|
grpc_chttp2_cancel_stream(s->t.get(), s, s->t->goaway_error, false);
|
|
1411
1418
|
}
|
|
1412
1419
|
}
|
|
1413
|
-
absl::Status status =
|
|
1420
|
+
absl::Status status = t->goaway_error;
|
|
1414
1421
|
grpc_core::Transport::StateWatcher::DisconnectInfo disconnect_info;
|
|
1415
1422
|
disconnect_info.reason = grpc_core::Transport::StateWatcher::kGoaway;
|
|
1416
1423
|
disconnect_info.http2_error_code = static_cast<Http2ErrorCode>(goaway_error);
|
|
@@ -1433,10 +1440,6 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
|
|
|
1433
1440
|
t->keepalive_time.millis() > max_keepalive_time_millis
|
|
1434
1441
|
? INT_MAX
|
|
1435
1442
|
: t->keepalive_time.millis() * KEEPALIVE_TIME_BACKOFF_MULTIPLIER;
|
|
1436
|
-
if (!grpc_core::IsSubchannelConnectionScalingEnabled()) {
|
|
1437
|
-
status.SetPayload(grpc_core::kKeepaliveThrottlingKey,
|
|
1438
|
-
absl::Cord(std::to_string(throttled_keepalive_time)));
|
|
1439
|
-
}
|
|
1440
1443
|
disconnect_info.keepalive_time =
|
|
1441
1444
|
grpc_core::Duration::Milliseconds(throttled_keepalive_time);
|
|
1442
1445
|
}
|
|
@@ -1493,11 +1496,7 @@ static void maybe_start_some_streams(grpc_chttp2_transport* t) {
|
|
|
1493
1496
|
grpc_core::GrpcStreamNetworkState(),
|
|
1494
1497
|
grpc_core::GrpcStreamNetworkState::kNotSentOnWire);
|
|
1495
1498
|
grpc_chttp2_cancel_stream(
|
|
1496
|
-
t, s,
|
|
1497
|
-
grpc_error_set_int(GRPC_ERROR_CREATE("Stream IDs exhausted"),
|
|
1498
|
-
grpc_core::StatusIntProperty::kRpcStatus,
|
|
1499
|
-
GRPC_STATUS_UNAVAILABLE),
|
|
1500
|
-
false);
|
|
1499
|
+
t, s, absl::UnavailableError("Stream IDs exhausted"), false);
|
|
1501
1500
|
}
|
|
1502
1501
|
}
|
|
1503
1502
|
}
|
|
@@ -1507,7 +1506,8 @@ static grpc_closure* add_closure_barrier(grpc_closure* closure) {
|
|
|
1507
1506
|
return closure;
|
|
1508
1507
|
}
|
|
1509
1508
|
|
|
1510
|
-
static void
|
|
1509
|
+
static void null_then_sched_closure_with_error(grpc_closure** closure,
|
|
1510
|
+
grpc_error_handle error) {
|
|
1511
1511
|
grpc_closure* c = *closure;
|
|
1512
1512
|
*closure = nullptr;
|
|
1513
1513
|
// null_then_schedule_closure might be run during a start_batch which might
|
|
@@ -1516,7 +1516,11 @@ static void null_then_sched_closure(grpc_closure** closure) {
|
|
|
1516
1516
|
// completion, have the application see it, and make a new operation on the
|
|
1517
1517
|
// call which recycles the batch BEFORE the call to start_batch completes,
|
|
1518
1518
|
// forcing a race.
|
|
1519
|
-
grpc_core::ExecCtx::Run(DEBUG_LOCATION, c,
|
|
1519
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, c, error);
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
static void null_then_sched_closure(grpc_closure** closure) {
|
|
1523
|
+
null_then_sched_closure_with_error(closure, absl::OkStatus());
|
|
1520
1524
|
}
|
|
1521
1525
|
|
|
1522
1526
|
void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
|
|
@@ -1626,14 +1630,10 @@ static void send_initial_metadata_locked(
|
|
|
1626
1630
|
s->trailing_metadata_buffer.Set(
|
|
1627
1631
|
grpc_core::GrpcStreamNetworkState(),
|
|
1628
1632
|
grpc_core::GrpcStreamNetworkState::kNotSentOnWire);
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
&t->closed_with_error, 1),
|
|
1634
|
-
grpc_core::StatusIntProperty::kRpcStatus,
|
|
1635
|
-
GRPC_STATUS_RESOURCE_EXHAUSTED),
|
|
1636
|
-
false);
|
|
1633
|
+
absl::Status status =
|
|
1634
|
+
absl::ResourceExhaustedError("Too many streams");
|
|
1635
|
+
grpc_core::StatusAddChild(&status, t->closed_with_error);
|
|
1636
|
+
grpc_chttp2_cancel_stream(t, s, std::move(status), false);
|
|
1637
1637
|
} else {
|
|
1638
1638
|
grpc_chttp2_list_add_waiting_for_concurrency(t, s);
|
|
1639
1639
|
maybe_start_some_streams(t);
|
|
@@ -1642,14 +1642,9 @@ static void send_initial_metadata_locked(
|
|
|
1642
1642
|
s->trailing_metadata_buffer.Set(
|
|
1643
1643
|
grpc_core::GrpcStreamNetworkState(),
|
|
1644
1644
|
grpc_core::GrpcStreamNetworkState::kNotSentOnWire);
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
GRPC_ERROR_CREATE_REFERENCING("Transport closed",
|
|
1649
|
-
&t->closed_with_error, 1),
|
|
1650
|
-
grpc_core::StatusIntProperty::kRpcStatus,
|
|
1651
|
-
GRPC_STATUS_UNAVAILABLE),
|
|
1652
|
-
false);
|
|
1645
|
+
absl::Status status = absl::UnavailableError("Transport closed");
|
|
1646
|
+
grpc_core::StatusAddChild(&status, t->closed_with_error);
|
|
1647
|
+
grpc_chttp2_cancel_stream(t, s, std::move(status), false);
|
|
1653
1648
|
}
|
|
1654
1649
|
} else {
|
|
1655
1650
|
GRPC_CHECK_NE(s->id, 0u);
|
|
@@ -2061,11 +2056,8 @@ void grpc_chttp2_keepalive_timeout(
|
|
|
2061
2056
|
grpc_core::StatusIntProperty::kHttp2Error,
|
|
2062
2057
|
static_cast<intptr_t>(Http2ErrorCode::kEnhanceYourCalm)),
|
|
2063
2058
|
/*immediate_disconnect_hint=*/true);
|
|
2064
|
-
close_transport_locked(
|
|
2065
|
-
|
|
2066
|
-
grpc_error_set_int(GRPC_ERROR_CREATE("keepalive timeout"),
|
|
2067
|
-
grpc_core::StatusIntProperty::kRpcStatus,
|
|
2068
|
-
GRPC_STATUS_UNAVAILABLE));
|
|
2059
|
+
close_transport_locked(t.get(),
|
|
2060
|
+
absl::UnavailableError("keepalive timeout"));
|
|
2069
2061
|
}),
|
|
2070
2062
|
absl::OkStatus());
|
|
2071
2063
|
}
|
|
@@ -2083,11 +2075,7 @@ void grpc_chttp2_ping_timeout(
|
|
|
2083
2075
|
grpc_core::StatusIntProperty::kHttp2Error,
|
|
2084
2076
|
static_cast<intptr_t>(Http2ErrorCode::kEnhanceYourCalm)),
|
|
2085
2077
|
/*immediate_disconnect_hint=*/true);
|
|
2086
|
-
close_transport_locked(
|
|
2087
|
-
t.get(),
|
|
2088
|
-
grpc_error_set_int(GRPC_ERROR_CREATE("ping timeout"),
|
|
2089
|
-
grpc_core::StatusIntProperty::kRpcStatus,
|
|
2090
|
-
GRPC_STATUS_UNAVAILABLE));
|
|
2078
|
+
close_transport_locked(t.get(), absl::UnavailableError("ping timeout"));
|
|
2091
2079
|
}),
|
|
2092
2080
|
absl::OkStatus());
|
|
2093
2081
|
}
|
|
@@ -2105,11 +2093,8 @@ void grpc_chttp2_settings_timeout(
|
|
|
2105
2093
|
grpc_core::StatusIntProperty::kHttp2Error,
|
|
2106
2094
|
static_cast<intptr_t>(Http2ErrorCode::kSettingsTimeout)),
|
|
2107
2095
|
/*immediate_disconnect_hint=*/true);
|
|
2108
|
-
close_transport_locked(
|
|
2109
|
-
|
|
2110
|
-
grpc_error_set_int(GRPC_ERROR_CREATE("settings timeout"),
|
|
2111
|
-
grpc_core::StatusIntProperty::kRpcStatus,
|
|
2112
|
-
GRPC_STATUS_UNAVAILABLE));
|
|
2096
|
+
close_transport_locked(t.get(),
|
|
2097
|
+
absl::UnavailableError("settings timeout"));
|
|
2113
2098
|
}),
|
|
2114
2099
|
absl::OkStatus());
|
|
2115
2100
|
}
|
|
@@ -2242,10 +2227,7 @@ void grpc_chttp2_exceeded_ping_strikes(grpc_chttp2_transport* t) {
|
|
|
2242
2227
|
static_cast<intptr_t>(Http2ErrorCode::kEnhanceYourCalm)),
|
|
2243
2228
|
/*immediate_disconnect_hint=*/true);
|
|
2244
2229
|
// The transport will be closed after the write is done
|
|
2245
|
-
close_transport_locked(
|
|
2246
|
-
t, grpc_error_set_int(GRPC_ERROR_CREATE("Too many pings"),
|
|
2247
|
-
grpc_core::StatusIntProperty::kRpcStatus,
|
|
2248
|
-
GRPC_STATUS_UNAVAILABLE));
|
|
2230
|
+
close_transport_locked(t, absl::UnavailableError("Too many pings"));
|
|
2249
2231
|
}
|
|
2250
2232
|
|
|
2251
2233
|
void grpc_chttp2_reset_ping_clock(grpc_chttp2_transport* t) {
|
|
@@ -2343,6 +2325,8 @@ void grpc_chttp2_maybe_complete_recv_initial_metadata(grpc_chttp2_transport* t,
|
|
|
2343
2325
|
t->registered_method_matcher_cb(t->accept_stream_cb_user_data,
|
|
2344
2326
|
s->recv_initial_metadata);
|
|
2345
2327
|
}
|
|
2328
|
+
s->max_recv_message_length =
|
|
2329
|
+
GetMaxRecvSizeFromCallContext(s->arena, t->max_recv_message_length);
|
|
2346
2330
|
null_then_sched_closure(&s->recv_initial_metadata_ready);
|
|
2347
2331
|
}
|
|
2348
2332
|
}
|
|
@@ -2415,7 +2399,36 @@ void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* t,
|
|
|
2415
2399
|
*s->call_failed_before_recv_message =
|
|
2416
2400
|
(s->published_metadata[1] != GRPC_METADATA_PUBLISHED_AT_CLOSE);
|
|
2417
2401
|
}
|
|
2418
|
-
|
|
2402
|
+
if (s->seen_error && s->message_size_limit_exceeded) {
|
|
2403
|
+
null_then_sched_closure_with_error(&s->recv_message_ready, error);
|
|
2404
|
+
} else {
|
|
2405
|
+
null_then_sched_closure(&s->recv_message_ready);
|
|
2406
|
+
}
|
|
2407
|
+
} else if (s->seen_error && s->message_size_limit_exceeded) {
|
|
2408
|
+
null_then_sched_closure_with_error(&s->recv_message_ready, error);
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2411
|
+
if (grpc_core::IsMessageSizeRefactoringEnabled() && s->seen_error &&
|
|
2412
|
+
s->message_size_limit_exceeded) {
|
|
2413
|
+
s->message_size_limit_exceeded = false;
|
|
2414
|
+
// Explicitly cancel the stream to fail the RPC immediately.
|
|
2415
|
+
// We delay the cancellation until the recv_message_ready closure is
|
|
2416
|
+
// executed to prevent re-entrancy issues. When the HTTP/2 frame deframer
|
|
2417
|
+
// in `grpc_deframe_unprocessed_incoming_frames`
|
|
2418
|
+
// returns a size violation error, invoking `grpc_chttp2_cancel_stream`
|
|
2419
|
+
// immediately triggers `grpc_chttp2_mark_stream_closed`. This in turn
|
|
2420
|
+
// synchronously re-enters `grpc_chttp2_maybe_complete_recv_message` while
|
|
2421
|
+
// the original deframing loop is still active on the call stack.
|
|
2422
|
+
//
|
|
2423
|
+
// Because the re-entrant invocation observes that the incoming frame
|
|
2424
|
+
// storage has been cleared but `s->recv_message_ready` is still non-null,
|
|
2425
|
+
// it preemptively schedules the closure as a standard/non-error stream
|
|
2426
|
+
// termination (i.e., via `null_then_sched_closure(...,
|
|
2427
|
+
// absl::OkStatus())`). By the time control returns to the initial (outer)
|
|
2428
|
+
// deframing loop to execute `null_then_sched_closure_with_error`, the
|
|
2429
|
+
// closure pointer is already null, causing the original error context to
|
|
2430
|
+
// be discarded.
|
|
2431
|
+
grpc_chttp2_cancel_stream(t, s, error, true, nullptr);
|
|
2419
2432
|
}
|
|
2420
2433
|
}();
|
|
2421
2434
|
|
|
@@ -2509,8 +2522,7 @@ void grpc_chttp2_cancel_stream(
|
|
|
2509
2522
|
grpc_error_handle due_to_error, bool tarpit,
|
|
2510
2523
|
grpc_core::ServerMetadataHandle send_trailing_metadata) {
|
|
2511
2524
|
if (!t->is_client && !s->sent_trailing_metadata &&
|
|
2512
|
-
|
|
2513
|
-
!(s->read_closed && s->write_closed)) {
|
|
2525
|
+
!absl::IsUnknown(due_to_error) && !(s->read_closed && s->write_closed)) {
|
|
2514
2526
|
close_from_api(t, s, due_to_error, tarpit,
|
|
2515
2527
|
std::move(send_trailing_metadata));
|
|
2516
2528
|
return;
|
|
@@ -2910,11 +2922,10 @@ static void end_all_the_calls(grpc_chttp2_transport* t,
|
|
|
2910
2922
|
grpc_error_handle error) {
|
|
2911
2923
|
intptr_t http2_error;
|
|
2912
2924
|
// If there is no explicit grpc or HTTP/2 error, set to UNAVAILABLE on server.
|
|
2913
|
-
if (!t->is_client &&
|
|
2925
|
+
if (!t->is_client && absl::IsUnknown(error) &&
|
|
2914
2926
|
!grpc_error_get_int(error, grpc_core::StatusIntProperty::kHttp2Error,
|
|
2915
2927
|
&http2_error)) {
|
|
2916
|
-
error =
|
|
2917
|
-
GRPC_STATUS_UNAVAILABLE);
|
|
2928
|
+
error = grpc_core::ReplaceStatusCode(error, absl::StatusCode::kUnavailable);
|
|
2918
2929
|
}
|
|
2919
2930
|
cancel_unstarted_streams(t, error, false);
|
|
2920
2931
|
std::vector<grpc_chttp2_stream*> to_cancel;
|
|
@@ -2997,12 +3008,11 @@ static grpc_error_handle try_http_parsing(grpc_chttp2_transport* t) {
|
|
|
2997
3008
|
}
|
|
2998
3009
|
if (parse_error.ok() &&
|
|
2999
3010
|
(parse_error = grpc_http_parser_eof(&parser)) == absl::OkStatus()) {
|
|
3000
|
-
error =
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
grpc_http2_status_to_grpc_status(response.status));
|
|
3011
|
+
error = absl::Status(
|
|
3012
|
+
static_cast<absl::StatusCode>(
|
|
3013
|
+
grpc_http2_status_to_grpc_status(response.status)),
|
|
3014
|
+
absl::StrCat("Trying to connect an http1.x server (HTTP status ",
|
|
3015
|
+
response.status, ")"));
|
|
3006
3016
|
}
|
|
3007
3017
|
|
|
3008
3018
|
grpc_http_parser_destroy(&parser);
|
|
@@ -124,6 +124,7 @@ TransportFlowControl::TransportFlowControl(absl::string_view peer_name,
|
|
|
124
124
|
MemoryOwner* memory_owner)
|
|
125
125
|
: memory_owner_(memory_owner),
|
|
126
126
|
enable_bdp_probe_(enable_bdp_probe),
|
|
127
|
+
bdp_ping_blocked_(true),
|
|
127
128
|
bdp_estimator_(peer_name) {}
|
|
128
129
|
|
|
129
130
|
uint32_t TransportFlowControl::DesiredAnnounceSize(bool writing_anyway) const {
|
|
@@ -348,6 +349,7 @@ std::string TransportFlowControl::Stats::ToString() const {
|
|
|
348
349
|
" announced_stream_total_over_incoming_window: ",
|
|
349
350
|
announced_stream_total_over_incoming_window,
|
|
350
351
|
" bdp_accumulator: ", bdp_accumulator,
|
|
352
|
+
" bdp_ping_blocked: ", bdp_ping_blocked,
|
|
351
353
|
" bdp_estimate: ", bdp_estimate,
|
|
352
354
|
" bdp_bw_est: ", bdp_bw_est);
|
|
353
355
|
}
|