grpc 1.83.1 → 1.84.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 +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/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 +32 -67
- 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 +3 -4
- 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/parsing.cc +5 -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/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 +60 -96
- data/src/core/lib/experiments/experiments.h +34 -50
- 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/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,6 +44,7 @@
|
|
|
44
44
|
#include "src/core/util/ref_counted_ptr.h"
|
|
45
45
|
#include "absl/log/log.h"
|
|
46
46
|
#include "absl/status/status.h"
|
|
47
|
+
#include "absl/strings/str_cat.h"
|
|
47
48
|
|
|
48
49
|
namespace grpc_core {
|
|
49
50
|
namespace http2 {
|
|
@@ -209,6 +210,16 @@ class StreamState {
|
|
|
209
210
|
std::atomic<bool> writes_closed_{false};
|
|
210
211
|
};
|
|
211
212
|
|
|
213
|
+
// Lifecycle state of a stream undergoing tarpitting.
|
|
214
|
+
enum class TarpitState : uint8_t {
|
|
215
|
+
// Stream has never been tarpitted.
|
|
216
|
+
kNone = 0,
|
|
217
|
+
// Stream is actively tarpitted (timer running in queue).
|
|
218
|
+
kActive = 1,
|
|
219
|
+
// Tarpit timer expired; executing final post-tarpit action.
|
|
220
|
+
kCompleted = 2,
|
|
221
|
+
};
|
|
222
|
+
|
|
212
223
|
// Managing the streams
|
|
213
224
|
class Stream : public RefCounted<Stream> {
|
|
214
225
|
public:
|
|
@@ -217,14 +228,9 @@ class Stream : public RefCounted<Stream> {
|
|
|
217
228
|
: flow_control_(&transport_flow_control),
|
|
218
229
|
call_(std::move(call_handler)),
|
|
219
230
|
state_(/*started=*/false),
|
|
220
|
-
stream_id_(kInvalidStreamId),
|
|
221
|
-
did_receive_initial_metadata_(false),
|
|
222
|
-
did_receive_trailing_metadata_(false),
|
|
223
|
-
did_push_server_trailing_metadata_(false),
|
|
224
|
-
did_cancel_(false),
|
|
225
231
|
data_queue_(MakeRefCounted<StreamDataQueue<ClientMetadataHandle>>(
|
|
226
|
-
std::get<CallHandler>(call_).arena(), /*is_client
|
|
227
|
-
/*queue_size
|
|
232
|
+
std::get<CallHandler>(call_).arena(), /*is_client=*/true,
|
|
233
|
+
/*queue_size=*/kStreamQueueSize)) {}
|
|
228
234
|
|
|
229
235
|
explicit Stream(CallInitiator call_initiator,
|
|
230
236
|
chttp2::TransportFlowControl& transport_flow_control,
|
|
@@ -234,13 +240,9 @@ class Stream : public RefCounted<Stream> {
|
|
|
234
240
|
call_(std::move(call_initiator)),
|
|
235
241
|
state_(/*started=*/true),
|
|
236
242
|
stream_id_(stream_id),
|
|
237
|
-
did_receive_initial_metadata_(false),
|
|
238
|
-
did_receive_trailing_metadata_(false),
|
|
239
|
-
did_push_server_trailing_metadata_(false),
|
|
240
|
-
did_cancel_(false),
|
|
241
243
|
data_queue_(MakeRefCounted<StreamDataQueue<ClientMetadataHandle>>(
|
|
242
|
-
std::get<CallInitiator>(call_).arena(), /*is_client
|
|
243
|
-
/*queue_size
|
|
244
|
+
std::get<CallInitiator>(call_).arena(), /*is_client=*/false,
|
|
245
|
+
/*queue_size=*/kStreamQueueSize)) {
|
|
244
246
|
InitializeStream(allow_true_binary_metadata_peer);
|
|
245
247
|
}
|
|
246
248
|
|
|
@@ -331,6 +333,44 @@ class Stream : public RefCounted<Stream> {
|
|
|
331
333
|
// gRPC stream state
|
|
332
334
|
bool IsClosedForReads() const { return state_.reads_closed(); }
|
|
333
335
|
bool IsClosedForWrites() const { return state_.writes_closed(); }
|
|
336
|
+
// Returns the current tarpit lifecycle state of the stream.
|
|
337
|
+
TarpitState GetTarpitState() const {
|
|
338
|
+
return tarpit_state_.load(std::memory_order_relaxed);
|
|
339
|
+
}
|
|
340
|
+
// Returns true if the stream has never entered the tarpit lifecycle.
|
|
341
|
+
bool WasNeverTarpitted() const {
|
|
342
|
+
return tarpit_state_.load(std::memory_order_relaxed) == TarpitState::kNone;
|
|
343
|
+
}
|
|
344
|
+
// Returns true if the stream is either actively tarpitted or has completed
|
|
345
|
+
// tarpitting.
|
|
346
|
+
bool IsTarpitted() const {
|
|
347
|
+
return tarpit_state_.load(std::memory_order_relaxed) != TarpitState::kNone;
|
|
348
|
+
}
|
|
349
|
+
// Returns true only while the tarpit timer is actively running.
|
|
350
|
+
bool IsTarpitTimerActive() const {
|
|
351
|
+
return tarpit_state_.load(std::memory_order_relaxed) ==
|
|
352
|
+
TarpitState::kActive;
|
|
353
|
+
}
|
|
354
|
+
// Returns true if tarpitting has completed. The stream may not yet be closed,
|
|
355
|
+
// but stream closure is imminent.
|
|
356
|
+
bool IsTarpitCompleted() const {
|
|
357
|
+
return tarpit_state_.load(std::memory_order_relaxed) ==
|
|
358
|
+
TarpitState::kCompleted;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// Transitions tarpit state from kNone to kActive.
|
|
362
|
+
void SetTarpitActive() {
|
|
363
|
+
GRPC_DCHECK(tarpit_state_.load(std::memory_order_relaxed) ==
|
|
364
|
+
TarpitState::kNone);
|
|
365
|
+
tarpit_state_.store(TarpitState::kActive, std::memory_order_relaxed);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// Transitions tarpit state from kActive to kCompleted.
|
|
369
|
+
void SetTarpitCompleted() {
|
|
370
|
+
GRPC_DCHECK(tarpit_state_.load(std::memory_order_relaxed) ==
|
|
371
|
+
TarpitState::kActive);
|
|
372
|
+
tarpit_state_.store(TarpitState::kCompleted, std::memory_order_relaxed);
|
|
373
|
+
}
|
|
334
374
|
|
|
335
375
|
// Semantic state transitions
|
|
336
376
|
void OnInitialMetadataSent() {
|
|
@@ -388,6 +428,7 @@ class Stream : public RefCounted<Stream> {
|
|
|
388
428
|
}
|
|
389
429
|
|
|
390
430
|
StreamStateChange OnInitiateReset(absl::Status status) {
|
|
431
|
+
GRPC_DCHECK(!status.ok());
|
|
391
432
|
const StreamStateChange change = state_.OnInitiateReset();
|
|
392
433
|
CancelCall(std::move(status));
|
|
393
434
|
return change;
|
|
@@ -399,14 +440,14 @@ class Stream : public RefCounted<Stream> {
|
|
|
399
440
|
return change;
|
|
400
441
|
}
|
|
401
442
|
|
|
402
|
-
|
|
443
|
+
uint32_t GetStreamId() const { return stream_id_; }
|
|
403
444
|
|
|
404
|
-
|
|
445
|
+
bool CanSendWindowUpdateFrames() const {
|
|
405
446
|
return IsOpen() || IsHalfClosedLocal();
|
|
406
447
|
}
|
|
407
448
|
|
|
408
|
-
|
|
409
|
-
if (
|
|
449
|
+
Http2Status CanStreamReceiveDataFrames() const {
|
|
450
|
+
if (IsClosedForReads()) {
|
|
410
451
|
return Http2Status::Http2StreamError(
|
|
411
452
|
Http2ErrorCode::kStreamClosed,
|
|
412
453
|
std::string(RFC9113::kHalfClosedRemoteState));
|
|
@@ -497,7 +538,7 @@ class Stream : public RefCounted<Stream> {
|
|
|
497
538
|
void InitializeStream(const bool allow_true_binary_metadata_peer) {
|
|
498
539
|
GRPC_HTTP2_STREAM_LOG << "Stream::InitializeStream stream_id="
|
|
499
540
|
<< stream_id_;
|
|
500
|
-
|
|
541
|
+
GRPC_DCHECK_NE(stream_id_, kInvalidStreamId);
|
|
501
542
|
data_queue_->SetStreamId(stream_id_, allow_true_binary_metadata_peer);
|
|
502
543
|
}
|
|
503
544
|
|
|
@@ -517,11 +558,12 @@ class Stream : public RefCounted<Stream> {
|
|
|
517
558
|
}
|
|
518
559
|
|
|
519
560
|
StreamState state_;
|
|
520
|
-
uint32_t stream_id_;
|
|
521
|
-
bool did_receive_initial_metadata_;
|
|
522
|
-
bool did_receive_trailing_metadata_;
|
|
523
|
-
bool did_push_server_trailing_metadata_;
|
|
524
|
-
bool did_cancel_;
|
|
561
|
+
uint32_t stream_id_ = kInvalidStreamId;
|
|
562
|
+
bool did_receive_initial_metadata_ = false;
|
|
563
|
+
bool did_receive_trailing_metadata_ = false;
|
|
564
|
+
bool did_push_server_trailing_metadata_ = false;
|
|
565
|
+
bool did_cancel_ = false;
|
|
566
|
+
std::atomic<TarpitState> tarpit_state_{TarpitState::kNone};
|
|
525
567
|
// Change this if ClientMetadataHandle and ServerMetadataHandle are changed
|
|
526
568
|
// to different types.
|
|
527
569
|
RefCountedPtr<StreamDataQueue<Arena::PoolPtr<grpc_metadata_batch>>>
|
|
@@ -105,9 +105,6 @@ static grpc_core::Duration NextAllowedPingInterval(grpc_chttp2_transport* t) {
|
|
|
105
105
|
// The gRPC keepalive spec doesn't call for any throttling on the server
|
|
106
106
|
// side, but we are adding some throttling for protection anyway, unless
|
|
107
107
|
// we are doing a graceful GOAWAY in which case we don't want to wait.
|
|
108
|
-
if (grpc_core::IsMultipingEnabled()) {
|
|
109
|
-
return grpc_core::Duration::Seconds(1);
|
|
110
|
-
}
|
|
111
108
|
return t->keepalive_time == grpc_core::Duration::Infinity()
|
|
112
109
|
? grpc_core::Duration::Seconds(20)
|
|
113
110
|
: t->keepalive_time / 2;
|
|
@@ -252,11 +252,7 @@ InprocServerTransport::MakeClientTransport() {
|
|
|
252
252
|
RefCountedPtr<Channel> MakeLameChannel(absl::string_view why,
|
|
253
253
|
absl::Status error) {
|
|
254
254
|
LOG(ERROR) << why << ": " << error.message();
|
|
255
|
-
|
|
256
|
-
grpc_status_code status = GRPC_STATUS_INTERNAL;
|
|
257
|
-
if (grpc_error_get_int(error, StatusIntProperty::kRpcStatus, &integer)) {
|
|
258
|
-
status = static_cast<grpc_status_code>(integer);
|
|
259
|
-
}
|
|
255
|
+
grpc_status_code status = static_cast<grpc_status_code>(error.code());
|
|
260
256
|
return RefCountedPtr<Channel>(Channel::FromC(grpc_lame_client_channel_create(
|
|
261
257
|
nullptr, status, std::string(why).c_str())));
|
|
262
258
|
}
|
|
@@ -1156,11 +1156,8 @@ void close_transport_locked(inproc_transport* t) {
|
|
|
1156
1156
|
// Also end all streams on this transport
|
|
1157
1157
|
while (t->stream_list != nullptr) {
|
|
1158
1158
|
// cancel_stream_locked also adjusts stream list
|
|
1159
|
-
cancel_stream_locked(
|
|
1160
|
-
|
|
1161
|
-
grpc_error_set_int(GRPC_ERROR_CREATE("Transport closed"),
|
|
1162
|
-
grpc_core::StatusIntProperty::kRpcStatus,
|
|
1163
|
-
GRPC_STATUS_UNAVAILABLE));
|
|
1159
|
+
cancel_stream_locked(t->stream_list,
|
|
1160
|
+
absl::UnavailableError("Transport closed"));
|
|
1164
1161
|
}
|
|
1165
1162
|
}
|
|
1166
1163
|
}
|
|
@@ -1295,12 +1292,7 @@ grpc_channel* grpc_legacy_inproc_channel_create(grpc_server* server,
|
|
|
1295
1292
|
GRPC_CHECK(!channel);
|
|
1296
1293
|
LOG(ERROR) << "Failed to create client channel: "
|
|
1297
1294
|
<< grpc_core::StatusToString(error);
|
|
1298
|
-
|
|
1299
|
-
grpc_status_code status = GRPC_STATUS_INTERNAL;
|
|
1300
|
-
if (grpc_error_get_int(error, grpc_core::StatusIntProperty::kRpcStatus,
|
|
1301
|
-
&integer)) {
|
|
1302
|
-
status = static_cast<grpc_status_code>(integer);
|
|
1303
|
-
}
|
|
1295
|
+
grpc_status_code status = static_cast<grpc_status_code>(error.code());
|
|
1304
1296
|
// client_transport was destroyed when grpc_channel_create_internal saw an
|
|
1305
1297
|
// error.
|
|
1306
1298
|
server_transport->Orphan();
|
|
@@ -1313,12 +1305,7 @@ grpc_channel* grpc_legacy_inproc_channel_create(grpc_server* server,
|
|
|
1313
1305
|
GRPC_CHECK(!channel);
|
|
1314
1306
|
LOG(ERROR) << "Failed to create server channel: "
|
|
1315
1307
|
<< grpc_core::StatusToString(error);
|
|
1316
|
-
|
|
1317
|
-
grpc_status_code status = GRPC_STATUS_INTERNAL;
|
|
1318
|
-
if (grpc_error_get_int(error, grpc_core::StatusIntProperty::kRpcStatus,
|
|
1319
|
-
&integer)) {
|
|
1320
|
-
status = static_cast<grpc_status_code>(integer);
|
|
1321
|
-
}
|
|
1308
|
+
grpc_status_code status = static_cast<grpc_status_code>(error.code());
|
|
1322
1309
|
client_transport->Orphan();
|
|
1323
1310
|
server_transport->Orphan();
|
|
1324
1311
|
channel = grpc_lame_client_channel_create(
|