grpc 1.83.2 → 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/etc/roots.pem +7940 -6467
- 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
data/include/grpc/credentials.h
CHANGED
|
@@ -60,6 +60,14 @@ grpc_service_account_jwt_access_credentials_create(const char* json_key,
|
|
|
60
60
|
GRPCAPI grpc_call_credentials* grpc_external_account_credentials_create(
|
|
61
61
|
const char* json_string, const char* scopes_string);
|
|
62
62
|
|
|
63
|
+
/** Builds Google Distributed Cloud Hosting Service Account credentials.
|
|
64
|
+
- json_string is the JSON string containing the service account key.
|
|
65
|
+
- audience_string is the intended recipient or service.
|
|
66
|
+
This API is used for experimental purposes for now and may change in the
|
|
67
|
+
future. */
|
|
68
|
+
GRPCAPI grpc_call_credentials* grpc_gdch_service_account_credentials_create(
|
|
69
|
+
const char* json_string, const char* audience_string);
|
|
70
|
+
|
|
63
71
|
/** Creates an Oauth2 Refresh Token credentials object for connecting to Google.
|
|
64
72
|
May return NULL if the input is invalid.
|
|
65
73
|
WARNING: Do NOT use this credentials to connect to a non-google service as
|
|
@@ -765,6 +773,8 @@ typedef struct grpc_tls_custom_verification_check_request {
|
|
|
765
773
|
* This value will only be filled if the cryptographic peer certificate
|
|
766
774
|
* verification was successful */
|
|
767
775
|
const char* verified_root_cert_subject;
|
|
776
|
+
/* The negotiated key exchange group. */
|
|
777
|
+
const char* negotiated_key_exchange_group;
|
|
768
778
|
} peer_info;
|
|
769
779
|
} grpc_tls_custom_verification_check_request;
|
|
770
780
|
|
|
@@ -44,6 +44,8 @@ extern "C" {
|
|
|
44
44
|
// https://www.openssl.org/docs/man1.1.0/man3/SSL_get_peer_cert_chain.html.
|
|
45
45
|
#define GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME "x509_pem_cert_chain"
|
|
46
46
|
#define GRPC_SSL_SESSION_REUSED_PROPERTY "ssl_session_reused"
|
|
47
|
+
#define GRPC_SSL_NEGOTIATED_KEY_EXCHANGE_GROUP_PROPERTY_NAME \
|
|
48
|
+
"ssl_negotiated_key_exchange_group"
|
|
47
49
|
#define GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME "security_level"
|
|
48
50
|
#define GRPC_PEER_DNS_PROPERTY_NAME "peer_dns"
|
|
49
51
|
#define GRPC_PEER_SPIFFE_ID_PROPERTY_NAME "peer_spiffe_id"
|
|
@@ -286,6 +286,15 @@
|
|
|
286
286
|
"grpc.experimental.tcp_min_read_chunk_size"
|
|
287
287
|
#define GRPC_ARG_TCP_MAX_READ_CHUNK_SIZE \
|
|
288
288
|
"grpc.experimental.tcp_max_read_chunk_size"
|
|
289
|
+
/** Channel arg (integer) setting an opt-in upper bound, in bytes, on the
|
|
290
|
+
adaptive read buffer size that a single TCP endpoint may preallocate for
|
|
291
|
+
reads. When unset (the default) the read buffer target grows as before,
|
|
292
|
+
preserving historical behavior. When set, the adaptive read target is
|
|
293
|
+
clamped to this value so occasional large reads do not leave a permanently
|
|
294
|
+
high read-buffer high-watermark. Unlike GRPC_ARG_TCP_MAX_READ_CHUNK_SIZE,
|
|
295
|
+
this does not change per-socket slice sizing. **/
|
|
296
|
+
#define GRPC_ARG_TCP_MAX_READ_BUFFER_SIZE \
|
|
297
|
+
"grpc.experimental.tcp_max_read_buffer_size"
|
|
289
298
|
/* TCP TX Zerocopy enable state: zero is disabled, non-zero is enabled. By
|
|
290
299
|
default, it is disabled. */
|
|
291
300
|
#define GRPC_ARG_TCP_TX_ZEROCOPY_ENABLED \
|
|
@@ -89,7 +89,8 @@
|
|
|
89
89
|
// failure (in which case the call will be aborted).
|
|
90
90
|
// useful for cases where the exact metadata returned needs to be customized.
|
|
91
91
|
// It's also acceptable to return a promise that resolves to the
|
|
92
|
-
// relevant return type listed above
|
|
92
|
+
// relevant return type listed above (except for OnClientToServerHalfClose
|
|
93
|
+
// and OnServerTrailingMetadata, which must be synchronous).
|
|
93
94
|
//
|
|
94
95
|
// OnFinalize is added to intercept call finalization.
|
|
95
96
|
// It must have one of the signatures:
|
|
@@ -1983,7 +1984,8 @@ class CallFilters {
|
|
|
1983
1984
|
return flag;
|
|
1984
1985
|
}
|
|
1985
1986
|
// Client: Fetch server initial metadata
|
|
1986
|
-
// Returns a promise that resolves to
|
|
1987
|
+
// Returns a promise that resolves to
|
|
1988
|
+
// ValueOrFailure<std::optional<ServerMetadataHandle>>
|
|
1987
1989
|
GRPC_MUST_USE_RESULT auto PullServerInitialMetadata() {
|
|
1988
1990
|
return Seq(
|
|
1989
1991
|
[this]() {
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
#include "src/core/lib/promise/try_seq.h"
|
|
47
47
|
#include "src/core/lib/resource_quota/arena.h"
|
|
48
48
|
#include "src/core/lib/slice/slice_buffer.h"
|
|
49
|
+
#include "src/core/lib/surface/call_utils.h"
|
|
49
50
|
#include "src/core/lib/surface/completion_queue.h"
|
|
50
51
|
#include "src/core/telemetry/stats.h"
|
|
51
52
|
#include "src/core/telemetry/stats_data.h"
|
|
@@ -62,7 +63,9 @@ namespace grpc_core {
|
|
|
62
63
|
|
|
63
64
|
namespace {
|
|
64
65
|
|
|
65
|
-
grpc_call_error ValidateClientBatch(
|
|
66
|
+
grpc_call_error ValidateClientBatch(
|
|
67
|
+
const grpc_op* ops, size_t nops,
|
|
68
|
+
CallOpInvariantsValidator& call_op_invariants_validator) {
|
|
66
69
|
BitSet<8> got_ops;
|
|
67
70
|
for (size_t op_idx = 0; op_idx < nops; op_idx++) {
|
|
68
71
|
const grpc_op& op = ops[op_idx];
|
|
@@ -94,7 +97,7 @@ grpc_call_error ValidateClientBatch(const grpc_op* ops, size_t nops) {
|
|
|
94
97
|
if (got_ops.is_set(op.op)) return GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
|
95
98
|
got_ops.set(op.op);
|
|
96
99
|
}
|
|
97
|
-
return
|
|
100
|
+
return call_op_invariants_validator.ValidateAndCommit(ops, nops);
|
|
98
101
|
}
|
|
99
102
|
|
|
100
103
|
} // namespace
|
|
@@ -161,7 +164,8 @@ grpc_call_error ClientCall::StartBatch(const grpc_op* ops, size_t nops,
|
|
|
161
164
|
EndOpImmediately(cq_, notify_tag, is_notify_tag_closure);
|
|
162
165
|
return GRPC_CALL_OK;
|
|
163
166
|
}
|
|
164
|
-
const grpc_call_error validation_result =
|
|
167
|
+
const grpc_call_error validation_result =
|
|
168
|
+
ValidateClientBatch(ops, nops, call_op_invariants_validator_);
|
|
165
169
|
if (validation_result != GRPC_CALL_OK) {
|
|
166
170
|
return validation_result;
|
|
167
171
|
}
|
|
@@ -325,8 +329,12 @@ void ClientCall::CommitBatch(const grpc_op* ops, size_t nops, void* notify_tag,
|
|
|
325
329
|
}
|
|
326
330
|
if (!is_notify_tag_closure) grpc_cq_begin_op(cq_, notify_tag);
|
|
327
331
|
BatchOpIndex op_index(ops, nops);
|
|
328
|
-
|
|
329
|
-
|
|
332
|
+
uint8_t concurrent_ops_to_reset = 0;
|
|
333
|
+
|
|
334
|
+
auto send_message = op_index.OpHandler<GRPC_OP_SEND_MESSAGE>(
|
|
335
|
+
[this, &concurrent_ops_to_reset](const grpc_op& op) {
|
|
336
|
+
concurrent_ops_to_reset |=
|
|
337
|
+
CallOpInvariantsValidator::OpBit(GRPC_OP_SEND_MESSAGE);
|
|
330
338
|
SliceBuffer send;
|
|
331
339
|
grpc_slice_buffer_swap(
|
|
332
340
|
&op.data.send_message.send_message->data.raw.slice_buffer,
|
|
@@ -344,8 +352,10 @@ void ClientCall::CommitBatch(const grpc_op* ops, size_t nops, void* notify_tag,
|
|
|
344
352
|
return Success{};
|
|
345
353
|
};
|
|
346
354
|
});
|
|
347
|
-
auto recv_message =
|
|
348
|
-
|
|
355
|
+
auto recv_message = op_index.OpHandler<GRPC_OP_RECV_MESSAGE>(
|
|
356
|
+
[this, &concurrent_ops_to_reset](const grpc_op& op) {
|
|
357
|
+
concurrent_ops_to_reset |=
|
|
358
|
+
CallOpInvariantsValidator::OpBit(GRPC_OP_RECV_MESSAGE);
|
|
349
359
|
return message_receiver_.MakeBatchOp(op, &started_call_initiator_);
|
|
350
360
|
});
|
|
351
361
|
auto recv_initial_metadata =
|
|
@@ -382,7 +392,9 @@ void ClientCall::CommitBatch(const grpc_op* ops, size_t nops, void* notify_tag,
|
|
|
382
392
|
AllOk<StatusFlag>(
|
|
383
393
|
TrySeq(std::move(send_message), std::move(send_close_from_client)),
|
|
384
394
|
TrySeq(std::move(recv_initial_metadata), std::move(recv_message))),
|
|
385
|
-
[
|
|
395
|
+
[guard = PrimaryOpsCleanup<ClientCall>(WeakRefAsSubclass<ClientCall>(),
|
|
396
|
+
concurrent_ops_to_reset)](
|
|
397
|
+
StatusFlag x) { return x; });
|
|
386
398
|
Party::WakeupHold wakeup_hold;
|
|
387
399
|
if (const grpc_op* op = op_index.op(GRPC_OP_SEND_INITIAL_METADATA)) {
|
|
388
400
|
wakeup_hold = StartCall(*op);
|
data/src/core/call/client_call.h
CHANGED
|
@@ -133,6 +133,9 @@ class ClientCall final
|
|
|
133
133
|
UnorderedStart* next;
|
|
134
134
|
};
|
|
135
135
|
|
|
136
|
+
template <typename T>
|
|
137
|
+
friend class PrimaryOpsCleanup;
|
|
138
|
+
|
|
136
139
|
void CommitBatch(const grpc_op* ops, size_t nops, void* notify_tag,
|
|
137
140
|
bool is_notify_tag_closure);
|
|
138
141
|
template <typename Batch>
|
|
@@ -178,6 +181,7 @@ class ClientCall final
|
|
|
178
181
|
// otherwise the server trailing metadata from started_call_initiator_ is
|
|
179
182
|
// authoritative.
|
|
180
183
|
SingleSetPtr<absl::Status> cancel_status_;
|
|
184
|
+
CallOpInvariantsValidator call_op_invariants_validator_;
|
|
181
185
|
MessageReceiver message_receiver_;
|
|
182
186
|
grpc_completion_queue* const cq_;
|
|
183
187
|
const RefCountedPtr<UnstartedCallDestination> call_destination_;
|
|
@@ -146,9 +146,11 @@ InterceptionChainBuilder::Build(FinalDestination final_destination) {
|
|
|
146
146
|
}
|
|
147
147
|
Interceptor* previous = top_interceptor_.get();
|
|
148
148
|
while (previous->wrapped_destination_ != nullptr) {
|
|
149
|
+
previous->Init(args_);
|
|
149
150
|
previous = DownCast<Interceptor*>(previous->wrapped_destination_.get());
|
|
150
151
|
}
|
|
151
152
|
previous->wrapped_destination_ = std::move(terminator);
|
|
153
|
+
previous->Init(args_);
|
|
152
154
|
return std::move(top_interceptor_);
|
|
153
155
|
}
|
|
154
156
|
|
|
@@ -93,7 +93,6 @@ class HijackedCall final {
|
|
|
93
93
|
// preceding filters. We don't actually have any use-case for seeing
|
|
94
94
|
// the unprocessed initial metadata and deciding to do a PassThrough(),
|
|
95
95
|
// and its presence in this API is confusing.
|
|
96
|
-
|
|
97
96
|
class Interceptor : public UnstartedCallDestination {
|
|
98
97
|
public:
|
|
99
98
|
using UnstartedCallDestination::UnstartedCallDestination;
|
|
@@ -106,6 +105,11 @@ class Interceptor : public UnstartedCallDestination {
|
|
|
106
105
|
}
|
|
107
106
|
|
|
108
107
|
protected:
|
|
108
|
+
// Performs initialization steps after the interception chain has been
|
|
109
|
+
// constructed. In particular, wrapped_destination() may be called
|
|
110
|
+
// from inside this method.
|
|
111
|
+
virtual void Init(const ChannelArgs& args) {}
|
|
112
|
+
|
|
109
113
|
virtual void InterceptCall(UnstartedCallHandler unstarted_call_handler) = 0;
|
|
110
114
|
|
|
111
115
|
// Returns a promise that resolves to a HijackedCall instance.
|
|
@@ -141,6 +145,15 @@ class Interceptor : public UnstartedCallDestination {
|
|
|
141
145
|
wrapped_destination_->StartCall(std::move(unstarted_call_handler));
|
|
142
146
|
}
|
|
143
147
|
|
|
148
|
+
// The next call destination in the interception chain. To be used by
|
|
149
|
+
// interceptors that need to delegate to their own interception chains.
|
|
150
|
+
//
|
|
151
|
+
// Note: This will not return a useful value until Init() has been
|
|
152
|
+
// called -- do NOT call this from within the ctor.
|
|
153
|
+
RefCountedPtr<UnstartedCallDestination> wrapped_destination() const {
|
|
154
|
+
return wrapped_destination_;
|
|
155
|
+
}
|
|
156
|
+
|
|
144
157
|
private:
|
|
145
158
|
friend class InterceptionChainBuilder;
|
|
146
159
|
|
data/src/core/call/metadata.cc
CHANGED
|
@@ -44,9 +44,7 @@ absl::Status ServerMetadataToStatus(ServerMetadata& md) {
|
|
|
44
44
|
absl::string_view message = error_slice != nullptr
|
|
45
45
|
? error_slice->as_string_view()
|
|
46
46
|
: absl::string_view();
|
|
47
|
-
return
|
|
48
|
-
absl::Status(static_cast<absl::StatusCode>(grpc_status), message),
|
|
49
|
-
StatusIntProperty::kRpcStatus, grpc_status);
|
|
47
|
+
return absl::Status(static_cast<absl::StatusCode>(grpc_status), message);
|
|
50
48
|
}
|
|
51
49
|
|
|
52
50
|
void SetServerMetadataFromStatus(ServerMetadata& md,
|
|
@@ -594,6 +594,14 @@ struct GrpcStreamNetworkState {
|
|
|
594
594
|
static std::string DisplayValue(ValueType x);
|
|
595
595
|
};
|
|
596
596
|
|
|
597
|
+
// Annotation added to indicate that the LB policy dropped the call.
|
|
598
|
+
struct LbPolicyDrop {
|
|
599
|
+
static absl::string_view DebugKey() { return "LbPolicyDrop"; }
|
|
600
|
+
static constexpr bool kRepeatable = false;
|
|
601
|
+
using ValueType = bool;
|
|
602
|
+
static absl::string_view DisplayValue(bool x) { return x ? "true" : "false"; }
|
|
603
|
+
};
|
|
604
|
+
|
|
597
605
|
// Annotation added by a server transport to note the peer making a request.
|
|
598
606
|
struct PeerString {
|
|
599
607
|
static absl::string_view DebugKey() { return "PeerString"; }
|
|
@@ -1752,11 +1760,11 @@ using grpc_metadata_batch_base = grpc_core::MetadataMap<
|
|
|
1752
1760
|
grpc_core::XEnvoyPeerMetadata, grpc_core::XForwardedForMetadata,
|
|
1753
1761
|
grpc_core::XForwardedHostMetadata, grpc_core::W3CTraceParentMetadata,
|
|
1754
1762
|
// Non-encodable things
|
|
1755
|
-
grpc_core::GrpcStreamNetworkState, grpc_core::
|
|
1756
|
-
grpc_core::
|
|
1757
|
-
grpc_core::
|
|
1758
|
-
grpc_core::
|
|
1759
|
-
grpc_core::GrpcTarPit,
|
|
1763
|
+
grpc_core::GrpcStreamNetworkState, grpc_core::LbPolicyDrop,
|
|
1764
|
+
grpc_core::PeerString, grpc_core::GrpcStatusContext,
|
|
1765
|
+
grpc_core::GrpcStatusFromWire, grpc_core::GrpcCallWasCancelled,
|
|
1766
|
+
grpc_core::WaitForReady, grpc_core::IsTransparentRetry,
|
|
1767
|
+
grpc_core::GrpcTrailersOnly, grpc_core::GrpcTarPit,
|
|
1760
1768
|
grpc_core::GrpcRegisteredMethod GRPC_CUSTOM_CLIENT_METADATA
|
|
1761
1769
|
GRPC_CUSTOM_SERVER_METADATA>;
|
|
1762
1770
|
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
#include <string.h>
|
|
34
34
|
|
|
35
35
|
#include <atomic>
|
|
36
|
+
#include <cstdint>
|
|
36
37
|
#include <memory>
|
|
37
38
|
#include <string>
|
|
38
39
|
#include <utility>
|
|
@@ -46,6 +47,7 @@
|
|
|
46
47
|
#include "src/core/lib/promise/try_seq.h"
|
|
47
48
|
#include "src/core/lib/resource_quota/arena.h"
|
|
48
49
|
#include "src/core/lib/slice/slice_buffer.h"
|
|
50
|
+
#include "src/core/lib/surface/call_utils.h"
|
|
49
51
|
#include "src/core/lib/surface/completion_queue.h"
|
|
50
52
|
#include "src/core/server/server_interface.h"
|
|
51
53
|
#include "src/core/util/bitset.h"
|
|
@@ -57,7 +59,9 @@ namespace grpc_core {
|
|
|
57
59
|
|
|
58
60
|
namespace {
|
|
59
61
|
|
|
60
|
-
grpc_call_error ValidateServerBatch(
|
|
62
|
+
grpc_call_error ValidateServerBatch(
|
|
63
|
+
const grpc_op* ops, size_t nops,
|
|
64
|
+
CallOpInvariantsValidator& call_op_invariants_validator) {
|
|
61
65
|
BitSet<8> got_ops;
|
|
62
66
|
for (size_t op_idx = 0; op_idx < nops; op_idx++) {
|
|
63
67
|
const grpc_op& op = ops[op_idx];
|
|
@@ -96,7 +100,7 @@ grpc_call_error ValidateServerBatch(const grpc_op* ops, size_t nops) {
|
|
|
96
100
|
if (got_ops.is_set(op.op)) return GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
|
97
101
|
got_ops.set(op.op);
|
|
98
102
|
}
|
|
99
|
-
return
|
|
103
|
+
return call_op_invariants_validator.ValidateAndCommit(ops, nops);
|
|
100
104
|
}
|
|
101
105
|
|
|
102
106
|
} // namespace
|
|
@@ -120,7 +124,8 @@ grpc_call_error ServerCall::StartBatch(const grpc_op* ops, size_t nops,
|
|
|
120
124
|
EndOpImmediately(cq_, notify_tag, is_notify_tag_closure);
|
|
121
125
|
return GRPC_CALL_OK;
|
|
122
126
|
}
|
|
123
|
-
const grpc_call_error validation_result =
|
|
127
|
+
const grpc_call_error validation_result =
|
|
128
|
+
ValidateServerBatch(ops, nops, call_op_invariants_validator_);
|
|
124
129
|
if (validation_result != GRPC_CALL_OK) {
|
|
125
130
|
return validation_result;
|
|
126
131
|
}
|
|
@@ -131,23 +136,33 @@ grpc_call_error ServerCall::StartBatch(const grpc_op* ops, size_t nops,
|
|
|
131
136
|
void ServerCall::CommitBatch(const grpc_op* ops, size_t nops, void* notify_tag,
|
|
132
137
|
bool is_notify_tag_closure) {
|
|
133
138
|
BatchOpIndex op_index(ops, nops);
|
|
139
|
+
uint8_t concurrent_ops_to_reset = 0;
|
|
134
140
|
if (!is_notify_tag_closure) grpc_cq_begin_op(cq_, notify_tag);
|
|
135
141
|
|
|
136
142
|
auto commit_with_send_ops = [&](auto send_ops) {
|
|
137
|
-
auto recv_message =
|
|
138
|
-
|
|
143
|
+
auto recv_message = op_index.OpHandler<GRPC_OP_RECV_MESSAGE>(
|
|
144
|
+
[this, &concurrent_ops_to_reset](const grpc_op& op) {
|
|
145
|
+
concurrent_ops_to_reset |=
|
|
146
|
+
CallOpInvariantsValidator::OpBit(GRPC_OP_RECV_MESSAGE);
|
|
139
147
|
return message_receiver_.MakeBatchOp(op, &call_handler_);
|
|
140
148
|
});
|
|
149
|
+
auto self = this->template WeakRefAsSubclass<ServerCall>();
|
|
141
150
|
auto primary_ops =
|
|
142
|
-
AllOk<StatusFlag>(std::move(send_ops), std::move(recv_message))
|
|
151
|
+
Map(AllOk<StatusFlag>(std::move(send_ops), std::move(recv_message)),
|
|
152
|
+
[guard = PrimaryOpsCleanup<ServerCall>(
|
|
153
|
+
std::move(self), concurrent_ops_to_reset)](StatusFlag x) {
|
|
154
|
+
return x;
|
|
155
|
+
});
|
|
156
|
+
|
|
143
157
|
if (auto* op = op_index.op(GRPC_OP_RECV_CLOSE_ON_SERVER)) {
|
|
144
158
|
auto recv_trailing_metadata = OpHandler<GRPC_OP_RECV_CLOSE_ON_SERVER>(
|
|
145
|
-
[
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
159
|
+
[self = WeakRef(),
|
|
160
|
+
cancelled = op->data.recv_close_on_server.cancelled]() {
|
|
161
|
+
return Map(self->call_handler_.WasCancelled(),
|
|
162
|
+
[cancelled, self](bool result) -> Success {
|
|
163
|
+
self->saw_was_cancelled_.store(
|
|
164
|
+
true, std::memory_order_relaxed);
|
|
165
|
+
self->ResetDeadline();
|
|
151
166
|
*cancelled = result ? 1 : 0;
|
|
152
167
|
return Success{};
|
|
153
168
|
});
|
|
@@ -232,8 +247,10 @@ void ServerCall::CommitBatch(const grpc_op* ops, size_t nops, void* notify_tag,
|
|
|
232
247
|
std::move(metadata));
|
|
233
248
|
};
|
|
234
249
|
});
|
|
235
|
-
auto send_message =
|
|
236
|
-
|
|
250
|
+
auto send_message = op_index.OpHandler<GRPC_OP_SEND_MESSAGE>(
|
|
251
|
+
[this, &concurrent_ops_to_reset](const grpc_op& op) {
|
|
252
|
+
concurrent_ops_to_reset |=
|
|
253
|
+
CallOpInvariantsValidator::OpBit(GRPC_OP_SEND_MESSAGE);
|
|
237
254
|
SliceBuffer send;
|
|
238
255
|
grpc_slice_buffer_swap(
|
|
239
256
|
&op.data.send_message.send_message->data.raw.slice_buffer,
|
data/src/core/call/server_call.h
CHANGED
|
@@ -158,12 +158,16 @@ class ServerCall final : public Call, public DualRefCounted<ServerCall> {
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
private:
|
|
161
|
+
template <typename T>
|
|
162
|
+
friend class PrimaryOpsCleanup;
|
|
163
|
+
|
|
161
164
|
void CommitBatch(const grpc_op* ops, size_t nops, void* notify_tag,
|
|
162
165
|
bool is_notify_tag_closure);
|
|
163
166
|
|
|
164
167
|
std::string DebugTag() { return absl::StrFormat("SERVER_CALL[%p]: ", this); }
|
|
165
168
|
|
|
166
169
|
CallHandler call_handler_;
|
|
170
|
+
CallOpInvariantsValidator call_op_invariants_validator_;
|
|
167
171
|
std::atomic<bool> sent_server_initial_metadata_batch_{false};
|
|
168
172
|
Latch<void> server_initial_metadata_scheduled_;
|
|
169
173
|
MessageReceiver message_receiver_;
|
|
@@ -56,10 +56,15 @@ std::string TextEncode(upb_Message* message,
|
|
|
56
56
|
auto* def = getmsgdef(def_pool);
|
|
57
57
|
size_t size = upb_TextEncode(message, def, def_pool, 0, buf, sizeof(buf));
|
|
58
58
|
if (size < sizeof(buf)) return std::string(buf, size);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
// upb_TextEncode has snprintf() semantics: it always NUL-terminates
|
|
60
|
+
// within the given capacity, so writing size content bytes requires
|
|
61
|
+
// a capacity of size + 1. We allocate size + 1 bytes in the string,
|
|
62
|
+
// let upb_TextEncode write the content and the NUL terminator, and then
|
|
63
|
+
// resize the string back to size to remove the NUL terminator from the
|
|
64
|
+
// string's active length.
|
|
65
|
+
std::string result(size + 1, '\0');
|
|
66
|
+
upb_TextEncode(message, def, def_pool, 0, result.data(), result.size());
|
|
67
|
+
result.resize(size);
|
|
63
68
|
return result;
|
|
64
69
|
}
|
|
65
70
|
|
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
#include "google/protobuf/duration.upb.h"
|
|
23
23
|
#include "google/protobuf/timestamp.upb.h"
|
|
24
24
|
#include "google/protobuf/wrappers.upb.h"
|
|
25
|
+
#include "grpc/channelz/v1/channelz.upb.h"
|
|
26
|
+
#include "grpc/channelz/v1/channelz.upbdefs.h"
|
|
25
27
|
#include "src/core/channelz/v2tov1/property_list.h"
|
|
26
28
|
#include "src/core/lib/address_utils/parse_address.h"
|
|
27
29
|
#include "src/core/lib/address_utils/sockaddr_utils.h"
|
|
@@ -29,8 +31,6 @@
|
|
|
29
31
|
#include "src/core/util/json/json_writer.h"
|
|
30
32
|
#include "src/core/util/upb_utils.h"
|
|
31
33
|
#include "src/core/util/uri.h"
|
|
32
|
-
#include "src/proto/grpc/channelz/channelz.upb.h"
|
|
33
|
-
#include "src/proto/grpc/channelz/channelz.upbdefs.h"
|
|
34
34
|
#include "src/proto/grpc/channelz/v2/channelz.upb.h"
|
|
35
35
|
#include "src/proto/grpc/channelz/v2/property_list.upb.h"
|
|
36
36
|
#include "upb/base/status.h"
|
|
@@ -63,8 +63,7 @@ static bool g_backup_polling_disabled;
|
|
|
63
63
|
|
|
64
64
|
void grpc_client_channel_global_init_backup_polling() {
|
|
65
65
|
g_backup_polling_disabled = grpc_core::IsEventEngineClientEnabled() &&
|
|
66
|
-
grpc_core::IsEventEngineListenerEnabled()
|
|
67
|
-
grpc_core::IsEventEngineDnsEnabled();
|
|
66
|
+
grpc_core::IsEventEngineListenerEnabled();
|
|
68
67
|
if (g_backup_polling_disabled) {
|
|
69
68
|
return;
|
|
70
69
|
}
|
|
@@ -275,39 +275,6 @@ class ClientChannel::SubchannelWrapper::WatcherWrapper
|
|
|
275
275
|
<< subchannel_wrapper_->subchannel_.get()
|
|
276
276
|
<< " watcher=" << watcher_.get()
|
|
277
277
|
<< " state=" << ConnectivityStateName(state) << " status=" << status;
|
|
278
|
-
if (!IsSubchannelConnectionScalingEnabled()) {
|
|
279
|
-
auto keepalive_throttling = status.GetPayload(kKeepaliveThrottlingKey);
|
|
280
|
-
if (keepalive_throttling.has_value()) {
|
|
281
|
-
int new_keepalive_time_ms = -1;
|
|
282
|
-
if (absl::SimpleAtoi(std::string(keepalive_throttling.value()),
|
|
283
|
-
&new_keepalive_time_ms)) {
|
|
284
|
-
Duration new_keepalive_time =
|
|
285
|
-
Duration::Milliseconds(new_keepalive_time_ms);
|
|
286
|
-
if (new_keepalive_time >
|
|
287
|
-
subchannel_wrapper_->client_channel_->keepalive_time_) {
|
|
288
|
-
subchannel_wrapper_->client_channel_->keepalive_time_ =
|
|
289
|
-
new_keepalive_time;
|
|
290
|
-
GRPC_TRACE_LOG(client_channel, INFO)
|
|
291
|
-
<< "client_channel="
|
|
292
|
-
<< subchannel_wrapper_->client_channel_.get()
|
|
293
|
-
<< ": throttling keepalive time to "
|
|
294
|
-
<< subchannel_wrapper_->client_channel_->keepalive_time_;
|
|
295
|
-
// Propagate the new keepalive time to all subchannels. This is so
|
|
296
|
-
// that new transports created by any subchannel (and not just the
|
|
297
|
-
// subchannel that received the GOAWAY), use the new keepalive time.
|
|
298
|
-
for (auto& [subchannel, _] :
|
|
299
|
-
subchannel_wrapper_->client_channel_->subchannel_map_) {
|
|
300
|
-
subchannel->ThrottleKeepaliveTime(new_keepalive_time);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
} else {
|
|
304
|
-
LOG(ERROR) << "client_channel="
|
|
305
|
-
<< subchannel_wrapper_->client_channel_.get()
|
|
306
|
-
<< ": Illegal keepalive throttling value "
|
|
307
|
-
<< std::string(keepalive_throttling.value());
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
278
|
// Propagate status only in state TF.
|
|
312
279
|
// We specifically want to avoid propagating the status for
|
|
313
280
|
// state IDLE that the real subchannel gave us only for the
|
|
@@ -586,6 +553,12 @@ absl::StatusOr<RefCountedPtr<Channel>> ClientChannel::Create(
|
|
|
586
553
|
if (target.empty()) {
|
|
587
554
|
return absl::InternalError("target URI is empty in client channel");
|
|
588
555
|
}
|
|
556
|
+
auto channel_args_mutator =
|
|
557
|
+
grpc_channel_args_get_client_channel_creation_mutator();
|
|
558
|
+
if (channel_args_mutator != nullptr) {
|
|
559
|
+
channel_args =
|
|
560
|
+
channel_args_mutator(target.c_str(), channel_args, GRPC_CLIENT_CHANNEL);
|
|
561
|
+
}
|
|
589
562
|
std::string uri_to_resolve = CoreConfiguration::Get()
|
|
590
563
|
.proxy_mapper_registry()
|
|
591
564
|
.MapName(target, &channel_args)
|
|
@@ -602,35 +602,6 @@ class ClientChannelFilter::SubchannelWrapper final
|
|
|
602
602
|
<< parent_.get() << " subchannel " << parent_->subchannel_.get()
|
|
603
603
|
<< " watcher=" << watcher_.get()
|
|
604
604
|
<< " state=" << ConnectivityStateName(state) << " status=" << status;
|
|
605
|
-
if (!IsSubchannelConnectionScalingEnabled()) {
|
|
606
|
-
auto keepalive_throttling = status.GetPayload(kKeepaliveThrottlingKey);
|
|
607
|
-
if (keepalive_throttling.has_value()) {
|
|
608
|
-
int new_keepalive_time_ms = -1;
|
|
609
|
-
if (absl::SimpleAtoi(std::string(keepalive_throttling.value()),
|
|
610
|
-
&new_keepalive_time_ms)) {
|
|
611
|
-
Duration new_keepalive_time =
|
|
612
|
-
Duration::Milliseconds(new_keepalive_time_ms);
|
|
613
|
-
if (new_keepalive_time > parent_->chand_->keepalive_time_) {
|
|
614
|
-
parent_->chand_->keepalive_time_ = new_keepalive_time;
|
|
615
|
-
GRPC_TRACE_LOG(client_channel, INFO)
|
|
616
|
-
<< "chand=" << parent_->chand_
|
|
617
|
-
<< ": throttling keepalive time to "
|
|
618
|
-
<< parent_->chand_->keepalive_time_;
|
|
619
|
-
// Propagate the new keepalive time to all subchannels. This is
|
|
620
|
-
// so that new transports created by any subchannel (and not
|
|
621
|
-
// just the subchannel that received the GOAWAY), use the new
|
|
622
|
-
// keepalive time.
|
|
623
|
-
for (auto& [subchannel, _] : parent_->chand_->subchannel_map_) {
|
|
624
|
-
subchannel->ThrottleKeepaliveTime(new_keepalive_time);
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
} else {
|
|
628
|
-
LOG(ERROR) << "chand=" << parent_->chand_
|
|
629
|
-
<< ": Illegal keepalive throttling value "
|
|
630
|
-
<< std::string(keepalive_throttling.value());
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
605
|
// Propagate status only in state TF.
|
|
635
606
|
// We specifically want to avoid propagating the status for
|
|
636
607
|
// state IDLE that the real subchannel gave us only for the
|
|
@@ -1043,7 +1014,7 @@ ClientChannelFilter::ClientChannelFilter(grpc_channel_element_args* args,
|
|
|
1043
1014
|
auto service_config =
|
|
1044
1015
|
ServiceConfigImpl::Create(channel_args_, *service_config_json);
|
|
1045
1016
|
if (!service_config.ok()) {
|
|
1046
|
-
*error =
|
|
1017
|
+
*error = service_config.status();
|
|
1047
1018
|
return;
|
|
1048
1019
|
}
|
|
1049
1020
|
default_service_config_ = std::move(*service_config);
|
|
@@ -1555,12 +1526,12 @@ void ClientChannelFilter::UpdateStateLocked(grpc_connectivity_state state,
|
|
|
1555
1526
|
if (!status.ok() || state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
|
|
1556
1527
|
GRPC_CHANNELZ_LOG(channelz_node_)
|
|
1557
1528
|
<< channelz::ChannelNode::GetChannelConnectivityStateChangeString(
|
|
1558
|
-
state)
|
|
1529
|
+
state)
|
|
1530
|
+
<< " status: " << status.ToString();
|
|
1559
1531
|
} else {
|
|
1560
1532
|
GRPC_CHANNELZ_LOG(channelz_node_)
|
|
1561
1533
|
<< channelz::ChannelNode::GetChannelConnectivityStateChangeString(
|
|
1562
|
-
state)
|
|
1563
|
-
<< " status: " << status.ToString();
|
|
1534
|
+
state);
|
|
1564
1535
|
}
|
|
1565
1536
|
}
|
|
1566
1537
|
}
|
|
@@ -1643,11 +1614,11 @@ grpc_error_handle ClientChannelFilter::DoPingLocked(grpc_transport_op* op) {
|
|
|
1643
1614
|
},
|
|
1644
1615
|
// Fail pick.
|
|
1645
1616
|
[](LoadBalancingPolicy::PickResult::Fail* fail_pick) {
|
|
1646
|
-
return
|
|
1617
|
+
return fail_pick->status;
|
|
1647
1618
|
},
|
|
1648
1619
|
// Drop pick.
|
|
1649
1620
|
[](LoadBalancingPolicy::PickResult::Drop* drop_pick) {
|
|
1650
|
-
return
|
|
1621
|
+
return drop_pick->status;
|
|
1651
1622
|
});
|
|
1652
1623
|
}
|
|
1653
1624
|
|
|
@@ -1683,11 +1654,7 @@ void ClientChannelFilter::StartTransportOpLocked(grpc_transport_op* op) {
|
|
|
1683
1654
|
<< "chand=" << this << ": disconnect_with_error: "
|
|
1684
1655
|
<< StatusToString(op->disconnect_with_error);
|
|
1685
1656
|
DestroyResolverAndLbPolicyLocked();
|
|
1686
|
-
|
|
1687
|
-
if (grpc_error_get_int(op->disconnect_with_error,
|
|
1688
|
-
StatusIntProperty::ChannelConnectivityState,
|
|
1689
|
-
&value) &&
|
|
1690
|
-
static_cast<grpc_connectivity_state>(value) == GRPC_CHANNEL_IDLE) {
|
|
1657
|
+
if (op->go_idle) {
|
|
1691
1658
|
if (disconnect_error_.ok()) { // Ignore if we're shutting down.
|
|
1692
1659
|
// Enter IDLE state.
|
|
1693
1660
|
UpdateStateAndPickerLocked(GRPC_CHANNEL_IDLE, absl::Status(),
|
|
@@ -1703,7 +1670,7 @@ void ClientChannelFilter::StartTransportOpLocked(grpc_transport_op* op) {
|
|
|
1703
1670
|
UpdateStateAndPickerLocked(
|
|
1704
1671
|
GRPC_CHANNEL_SHUTDOWN, absl::Status(), "shutdown from API",
|
|
1705
1672
|
MakeRefCounted<LoadBalancingPolicy::TransientFailurePicker>(
|
|
1706
|
-
|
|
1673
|
+
op->disconnect_with_error));
|
|
1707
1674
|
// TODO(roth): If this happens when we're still waiting for a
|
|
1708
1675
|
// resolver result, we need to trigger failures for all calls in
|
|
1709
1676
|
// the resolver queue here.
|
|
@@ -1875,8 +1842,8 @@ grpc_error_handle ClientChannelFilter::CallData::ApplyServiceConfigToCallLocked(
|
|
|
1875
1842
|
->GetCallConfig({send_initial_metadata(), arena_,
|
|
1876
1843
|
service_config_call_data});
|
|
1877
1844
|
if (!filter_chain.ok()) {
|
|
1878
|
-
return
|
|
1879
|
-
|
|
1845
|
+
return MaybeRewriteIllegalStatusCode(filter_chain.status(),
|
|
1846
|
+
"ConfigSelector");
|
|
1880
1847
|
}
|
|
1881
1848
|
dynamic_filters_ = filter_chain->TakeAsSubclass<const DynamicFilters>();
|
|
1882
1849
|
// Apply our own method params to the call.
|
|
@@ -1946,7 +1913,7 @@ bool ClientChannelFilter::CallData::CheckResolutionLocked(
|
|
|
1946
1913
|
GRPC_TRACE_LOG(client_channel_call, INFO)
|
|
1947
1914
|
<< "chand=" << chand() << " calld=" << this
|
|
1948
1915
|
<< ": resolution failed, failing call";
|
|
1949
|
-
*config_selector =
|
|
1916
|
+
*config_selector = resolver_error;
|
|
1950
1917
|
return true;
|
|
1951
1918
|
}
|
|
1952
1919
|
// Either the resolver has not yet returned a result, or it has
|
|
@@ -2482,6 +2449,9 @@ ClientChannelFilter::LoadBalancedCall::PickSubchannel(bool was_queued) {
|
|
|
2482
2449
|
bool ClientChannelFilter::LoadBalancedCall::PickSubchannelImpl(
|
|
2483
2450
|
LoadBalancingPolicy::SubchannelPicker* picker, grpc_error_handle* error) {
|
|
2484
2451
|
GRPC_CHECK(subchannel_call_ == nullptr);
|
|
2452
|
+
// Adding the call arena to TLS so that LB pickers can access call context
|
|
2453
|
+
// from the arena.
|
|
2454
|
+
promise_detail::Context<Arena> arena_ctx(arena_);
|
|
2485
2455
|
// Perform LB pick.
|
|
2486
2456
|
LoadBalancingPolicy::PickArgs pick_args;
|
|
2487
2457
|
Slice* path = send_initial_metadata()->get_pointer(HttpPathMetadata());
|
|
@@ -2554,8 +2524,8 @@ bool ClientChannelFilter::LoadBalancedCall::PickSubchannelImpl(
|
|
|
2554
2524
|
if (!send_initial_metadata()
|
|
2555
2525
|
->GetOrCreatePointer(WaitForReady())
|
|
2556
2526
|
->value) {
|
|
2557
|
-
*error =
|
|
2558
|
-
|
|
2527
|
+
*error = MaybeRewriteIllegalStatusCode(std::move(fail_pick->status),
|
|
2528
|
+
"LB pick");
|
|
2559
2529
|
return true;
|
|
2560
2530
|
}
|
|
2561
2531
|
// If wait_for_ready is true, then queue to retry when we get a new
|
|
@@ -2567,10 +2537,9 @@ bool ClientChannelFilter::LoadBalancedCall::PickSubchannelImpl(
|
|
|
2567
2537
|
GRPC_TRACE_LOG(client_channel_lb_call, INFO)
|
|
2568
2538
|
<< "chand=" << chand_ << " lb_call=" << this
|
|
2569
2539
|
<< ": LB pick dropped: " << drop_pick->status;
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
StatusIntProperty::kLbPolicyDrop, 1);
|
|
2540
|
+
is_drop_ = true;
|
|
2541
|
+
*error = MaybeRewriteIllegalStatusCode(std::move(drop_pick->status),
|
|
2542
|
+
"LB drop");
|
|
2574
2543
|
return true;
|
|
2575
2544
|
});
|
|
2576
2545
|
}
|
|
@@ -2708,7 +2677,7 @@ void ClientChannelFilter::LoadBalancedCall::RecvTrailingMetadataReady(
|
|
|
2708
2677
|
<< " call_attempt_tracer_=" << self->call_attempt_tracer_
|
|
2709
2678
|
<< " lb_subchannel_call_tracker_="
|
|
2710
2679
|
<< self->lb_subchannel_call_tracker_.get()
|
|
2711
|
-
<< "
|
|
2680
|
+
<< " is_drop_=" << self->is_drop_;
|
|
2712
2681
|
// Check if we have a tracer or an LB callback to invoke.
|
|
2713
2682
|
if (self->call_attempt_tracer_ != nullptr ||
|
|
2714
2683
|
self->lb_subchannel_call_tracker_ != nullptr) {
|
|
@@ -2742,11 +2711,9 @@ void ClientChannelFilter::LoadBalancedCall::RecvTrailingMetadataReady(
|
|
|
2742
2711
|
self->RecordCallCompletion(status, self->recv_trailing_metadata_,
|
|
2743
2712
|
self->transport_stream_stats_, peer_string);
|
|
2744
2713
|
}
|
|
2714
|
+
// If we dropped the call, indicate that fact in the metadata.
|
|
2715
|
+
if (self->is_drop_) self->recv_trailing_metadata_->Set(LbPolicyDrop(), true);
|
|
2745
2716
|
// Chain to original callback.
|
|
2746
|
-
if (!self->failure_error_.ok()) {
|
|
2747
|
-
error = self->failure_error_;
|
|
2748
|
-
self->failure_error_ = absl::OkStatus();
|
|
2749
|
-
}
|
|
2750
2717
|
Closure::Run(DEBUG_LOCATION, self->original_recv_trailing_metadata_ready_,
|
|
2751
2718
|
error);
|
|
2752
2719
|
}
|