grpc 1.64.3 → 1.65.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Makefile +57 -58
- data/include/grpc/event_engine/event_engine.h +13 -6
- data/include/grpc/impl/channel_arg_names.h +7 -3
- data/include/grpc/module.modulemap +1 -0
- data/include/grpc/passive_listener.h +62 -0
- data/include/grpc/support/log.h +1 -6
- data/include/grpc/support/port_platform.h +3 -0
- data/src/core/channelz/channel_trace.cc +1 -1
- data/src/core/channelz/channel_trace.h +1 -1
- data/src/core/channelz/channelz.cc +3 -3
- data/src/core/channelz/channelz.h +7 -7
- data/src/core/channelz/channelz_registry.cc +4 -3
- data/src/core/client_channel/backup_poller.cc +4 -5
- data/src/core/client_channel/client_channel.cc +1324 -0
- data/src/core/client_channel/client_channel.h +243 -0
- data/src/core/client_channel/client_channel_filter.cc +266 -709
- data/src/core/client_channel/client_channel_filter.h +11 -64
- data/src/core/client_channel/client_channel_internal.h +16 -5
- data/src/core/client_channel/client_channel_plugin.cc +1 -14
- data/src/core/client_channel/client_channel_service_config.h +3 -3
- data/src/core/client_channel/config_selector.cc +1 -1
- data/src/core/client_channel/config_selector.h +1 -1
- data/src/core/client_channel/dynamic_filters.cc +3 -3
- data/src/core/client_channel/dynamic_filters.h +1 -3
- data/src/core/client_channel/load_balanced_call_destination.cc +336 -0
- data/src/core/client_channel/load_balanced_call_destination.h +49 -0
- data/src/core/client_channel/retry_filter.cc +2 -9
- data/src/core/client_channel/retry_filter.h +2 -7
- data/src/core/client_channel/retry_filter_legacy_call_data.cc +65 -72
- data/src/core/client_channel/retry_filter_legacy_call_data.h +0 -2
- data/src/core/client_channel/retry_service_config.cc +4 -5
- data/src/core/client_channel/retry_service_config.h +3 -3
- data/src/core/client_channel/subchannel.cc +220 -112
- data/src/core/client_channel/subchannel.h +31 -18
- data/src/core/client_channel/subchannel_pool_interface.cc +0 -2
- data/src/core/client_channel/subchannel_pool_interface.h +2 -4
- data/src/core/client_channel/subchannel_stream_client.cc +36 -49
- data/src/core/client_channel/subchannel_stream_client.h +2 -4
- data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +7 -10
- data/src/core/ext/filters/backend_metrics/backend_metric_filter.h +1 -0
- data/src/core/ext/filters/backend_metrics/backend_metric_provider.h +7 -0
- data/src/core/ext/filters/census/grpc_context.cc +2 -4
- data/src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc +8 -15
- data/src/core/ext/filters/channel_idle/legacy_channel_idle_filter.h +2 -0
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +3 -7
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +1 -0
- data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.h +3 -3
- data/src/core/ext/filters/http/client/http_client_filter.cc +1 -0
- data/src/core/ext/filters/http/client/http_client_filter.h +1 -0
- data/src/core/ext/filters/http/client_authority_filter.cc +1 -0
- data/src/core/ext/filters/http/client_authority_filter.h +1 -0
- data/src/core/ext/filters/http/message_compress/compression_filter.cc +10 -15
- data/src/core/ext/filters/http/message_compress/compression_filter.h +2 -0
- data/src/core/ext/filters/http/server/http_server_filter.cc +2 -2
- data/src/core/ext/filters/http/server/http_server_filter.h +1 -0
- data/src/core/ext/filters/message_size/message_size_filter.cc +6 -9
- data/src/core/ext/filters/message_size/message_size_filter.h +6 -6
- data/src/core/ext/filters/rbac/rbac_filter.cc +2 -5
- data/src/core/ext/filters/rbac/rbac_filter.h +1 -0
- data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +2 -2
- data/src/core/ext/filters/rbac/rbac_service_config_parser.h +1 -1
- data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +2 -6
- data/src/core/ext/filters/stateful_session/stateful_session_filter.h +1 -0
- data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h +3 -3
- data/src/core/ext/transport/chttp2/alpn/alpn.cc +1 -1
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +8 -25
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +0 -5
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +223 -148
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +33 -0
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +131 -107
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +8 -8
- data/src/core/ext/transport/chttp2/transport/context_list_entry.h +1 -1
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +2 -4
- data/src/core/ext/transport/chttp2/transport/flow_control.h +0 -2
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +4 -6
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +1 -2
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +9 -5
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +5 -4
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +9 -2
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +32 -43
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +1 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +3 -8
- data/src/core/ext/transport/chttp2/transport/http2_settings.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +1 -1
- data/src/core/ext/transport/chttp2/transport/internal.h +29 -19
- data/src/core/ext/transport/chttp2/transport/parsing.cc +15 -25
- data/src/core/ext/transport/chttp2/transport/ping_callbacks.cc +0 -2
- data/src/core/ext/transport/chttp2/transport/ping_callbacks.h +0 -2
- data/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc +29 -13
- data/src/core/ext/transport/chttp2/transport/ping_rate_policy.h +5 -4
- data/src/core/ext/transport/chttp2/transport/stream_lists.cc +3 -5
- data/src/core/ext/transport/chttp2/transport/writing.cc +24 -25
- data/src/core/ext/transport/inproc/inproc_transport.cc +56 -32
- data/src/core/ext/transport/inproc/inproc_transport.h +1 -3
- data/src/core/ext/transport/inproc/legacy_inproc_transport.cc +13 -15
- data/src/core/ext/transport/inproc/legacy_inproc_transport.h +0 -2
- data/src/core/handshaker/handshaker.cc +6 -14
- data/src/core/handshaker/http_connect/http_connect_handshaker.cc +9 -17
- data/src/core/handshaker/http_connect/http_proxy_mapper.cc +3 -2
- data/src/core/handshaker/security/secure_endpoint.cc +38 -32
- data/src/core/handshaker/security/secure_endpoint.h +0 -2
- data/src/core/handshaker/security/security_handshaker.cc +25 -37
- data/src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc +2 -1
- data/src/core/lib/address_utils/parse_address.cc +27 -39
- data/src/core/lib/address_utils/sockaddr_utils.cc +5 -6
- data/src/core/lib/avl/avl.h +1 -1
- data/src/core/lib/channel/channel_args.cc +13 -17
- data/src/core/lib/channel/channel_args.h +19 -8
- data/src/core/lib/channel/channel_stack.cc +5 -63
- data/src/core/lib/channel/channel_stack.h +13 -37
- data/src/core/lib/channel/channel_stack_builder.h +0 -5
- data/src/core/lib/channel/channel_stack_builder_impl.cc +0 -142
- data/src/core/lib/channel/channel_stack_builder_impl.h +0 -2
- data/src/core/lib/channel/connected_channel.cc +37 -676
- data/src/core/lib/channel/promise_based_filter.cc +41 -47
- data/src/core/lib/channel/promise_based_filter.h +124 -477
- data/src/core/lib/channel/status_util.cc +1 -1
- data/src/core/lib/compression/compression.cc +1 -1
- data/src/core/lib/compression/message_compress.cc +6 -6
- data/src/core/lib/config/config_vars.cc +2 -7
- data/src/core/lib/config/config_vars.h +1 -5
- data/src/core/lib/debug/event_log.h +1 -1
- data/src/core/lib/debug/trace.cc +43 -59
- data/src/core/lib/debug/trace.h +2 -97
- data/src/core/lib/debug/trace_flags.cc +255 -0
- data/src/core/lib/debug/trace_flags.h +133 -0
- data/src/core/lib/debug/trace_impl.h +115 -0
- data/src/core/lib/event_engine/ares_resolver.cc +5 -7
- data/src/core/lib/event_engine/ares_resolver.h +1 -3
- data/src/core/lib/event_engine/cf_engine/cf_engine.cc +1 -1
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc +17 -22
- data/src/core/lib/event_engine/event_engine.cc +29 -4
- data/src/core/lib/event_engine/extensions/supports_fd.h +7 -0
- data/src/core/lib/event_engine/extensions/tcp_trace.h +43 -0
- data/src/core/lib/event_engine/forkable.cc +4 -5
- data/src/core/lib/event_engine/forkable.h +0 -11
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +10 -11
- data/src/core/lib/event_engine/posix_engine/internal_errqueue.cc +4 -3
- data/src/core/lib/event_engine/posix_engine/native_posix_dns_resolver.cc +1 -1
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +19 -33
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +3 -2
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +24 -7
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +2 -0
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +14 -16
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +18 -22
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +13 -17
- data/src/core/lib/event_engine/posix_engine/timer.cc +1 -1
- data/src/core/lib/event_engine/posix_engine/timer_manager.cc +4 -6
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc +2 -1
- data/src/core/lib/event_engine/shim.cc +1 -1
- data/src/core/lib/event_engine/tcp_socket_utils.cc +6 -8
- data/src/core/lib/event_engine/thread_local.h +1 -1
- data/src/core/lib/event_engine/thread_pool/thread_count.h +1 -1
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +19 -21
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +3 -6
- data/src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc +14 -13
- data/src/core/lib/event_engine/thready_event_engine/thready_event_engine.h +4 -3
- data/src/core/lib/event_engine/trace.h +6 -17
- data/src/core/lib/event_engine/windows/iocp.h +1 -1
- data/src/core/lib/event_engine/windows/win_socket.cc +23 -17
- data/src/core/lib/event_engine/windows/win_socket.h +4 -5
- data/src/core/lib/event_engine/windows/windows_endpoint.cc +6 -9
- data/src/core/lib/event_engine/windows/windows_engine.cc +201 -87
- data/src/core/lib/event_engine/windows/windows_engine.h +136 -25
- data/src/core/lib/event_engine/windows/windows_listener.cc +12 -23
- data/src/core/lib/experiments/experiments.cc +35 -151
- data/src/core/lib/experiments/experiments.h +12 -45
- data/src/core/lib/gprpp/bitset.h +1 -1
- data/src/core/lib/gprpp/crash.cc +2 -3
- data/src/core/lib/gprpp/dual_ref_counted.h +45 -33
- data/src/core/lib/gprpp/dump_args.cc +54 -0
- data/src/core/lib/gprpp/dump_args.h +69 -0
- data/src/core/lib/gprpp/glob.cc +70 -0
- data/src/core/lib/gprpp/glob.h +29 -0
- data/src/core/lib/gprpp/per_cpu.cc +1 -1
- data/src/core/lib/gprpp/posix/stat.cc +3 -4
- data/src/core/lib/gprpp/posix/thd.cc +8 -9
- data/src/core/lib/gprpp/ref_counted.h +30 -22
- data/src/core/lib/gprpp/single_set_ptr.h +5 -3
- data/src/core/lib/gprpp/status_helper.cc +11 -30
- data/src/core/lib/gprpp/status_helper.h +3 -31
- data/src/core/lib/gprpp/time.cc +3 -4
- data/src/core/lib/gprpp/time.h +3 -2
- data/src/core/lib/gprpp/unique_type_name.h +1 -1
- data/src/core/lib/gprpp/validation_errors.cc +10 -1
- data/src/core/lib/gprpp/validation_errors.h +11 -0
- data/src/core/lib/gprpp/windows/stat.cc +3 -4
- data/src/core/lib/gprpp/windows/thd.cc +3 -2
- data/src/core/lib/gprpp/work_serializer.cc +48 -57
- data/src/core/lib/iomgr/buffer_list.cc +4 -2
- data/src/core/lib/iomgr/call_combiner.cc +18 -27
- data/src/core/lib/iomgr/call_combiner.h +1 -3
- data/src/core/lib/iomgr/cfstream_handle.cc +4 -6
- data/src/core/lib/iomgr/closure.h +2 -4
- data/src/core/lib/iomgr/combiner.cc +6 -8
- data/src/core/lib/iomgr/combiner.h +0 -2
- data/src/core/lib/iomgr/endpoint.cc +0 -6
- data/src/core/lib/iomgr/endpoint.h +0 -2
- data/src/core/lib/iomgr/endpoint_cfstream.cc +19 -41
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +1 -1
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +5 -6
- data/src/core/lib/iomgr/error.cc +13 -21
- data/src/core/lib/iomgr/error.h +1 -1
- data/src/core/lib/iomgr/ev_apple.cc +3 -5
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +43 -42
- data/src/core/lib/iomgr/ev_poll_posix.cc +38 -29
- data/src/core/lib/iomgr/ev_posix.cc +8 -9
- data/src/core/lib/iomgr/ev_posix.h +10 -7
- data/src/core/lib/iomgr/event_engine_shims/closure.cc +2 -2
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +14 -28
- data/src/core/lib/iomgr/exec_ctx.cc +2 -2
- data/src/core/lib/iomgr/exec_ctx.h +1 -1
- data/src/core/lib/iomgr/executor.cc +6 -15
- data/src/core/lib/iomgr/executor.h +1 -1
- data/src/core/lib/iomgr/fork_posix.cc +8 -10
- data/src/core/lib/iomgr/fork_windows.cc +3 -1
- data/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc +2 -3
- data/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc +3 -5
- data/src/core/lib/iomgr/internal_errqueue.cc +4 -2
- data/src/core/lib/iomgr/iocp_windows.cc +4 -3
- data/src/core/lib/iomgr/iomgr.cc +13 -17
- data/src/core/lib/iomgr/lockfree_event.cc +3 -5
- data/src/core/lib/iomgr/pollset.h +0 -2
- data/src/core/lib/iomgr/pollset_windows.cc +0 -2
- data/src/core/lib/iomgr/resolve_address_posix.cc +7 -14
- data/src/core/lib/iomgr/resolve_address_windows.cc +1 -1
- data/src/core/lib/iomgr/socket_factory_posix.cc +1 -1
- data/src/core/lib/iomgr/socket_mutator.cc +1 -1
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +11 -17
- data/src/core/lib/iomgr/socket_windows.cc +4 -6
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +3 -5
- data/src/core/lib/iomgr/tcp_client_posix.cc +9 -15
- data/src/core/lib/iomgr/tcp_client_windows.cc +2 -4
- data/src/core/lib/iomgr/tcp_posix.cc +57 -84
- data/src/core/lib/iomgr/tcp_posix.h +0 -2
- data/src/core/lib/iomgr/tcp_server_posix.cc +3 -3
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +4 -6
- data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +7 -7
- data/src/core/lib/iomgr/tcp_server_windows.cc +10 -16
- data/src/core/lib/iomgr/tcp_windows.cc +25 -41
- data/src/core/lib/iomgr/timer_generic.cc +17 -20
- data/src/core/lib/iomgr/timer_heap.cc +1 -1
- data/src/core/lib/iomgr/timer_manager.cc +17 -30
- data/src/core/lib/iomgr/unix_sockets_posix.cc +1 -1
- data/src/core/lib/iomgr/vsock.cc +1 -1
- data/src/core/lib/iomgr/wakeup_fd_pipe.cc +3 -3
- data/src/core/lib/promise/activity.h +27 -4
- data/src/core/lib/promise/cancel_callback.h +24 -0
- data/src/core/lib/promise/context.h +11 -0
- data/src/core/lib/promise/detail/basic_seq.h +1 -2
- data/src/core/lib/promise/detail/join_state.h +354 -398
- data/src/core/lib/promise/detail/promise_like.h +6 -5
- data/src/core/lib/promise/detail/seq_state.h +1178 -1178
- data/src/core/lib/promise/for_each.h +6 -6
- data/src/core/lib/promise/interceptor_list.h +6 -7
- data/src/core/lib/promise/latch.h +9 -9
- data/src/core/lib/promise/map.h +17 -0
- data/src/core/lib/promise/observable.h +182 -0
- data/src/core/lib/promise/party.cc +7 -8
- data/src/core/lib/promise/party.h +10 -8
- data/src/core/lib/promise/pipe.h +16 -35
- data/src/core/lib/promise/promise.h +1 -0
- data/src/core/lib/promise/status_flag.h +2 -0
- data/src/core/lib/resource_quota/arena.cc +56 -79
- data/src/core/lib/resource_quota/arena.h +118 -209
- data/src/core/lib/resource_quota/memory_quota.cc +12 -13
- data/src/core/lib/resource_quota/memory_quota.h +2 -3
- data/src/core/lib/resource_quota/periodic_update.cc +1 -1
- data/src/core/lib/resource_quota/resource_quota.h +1 -1
- data/src/core/lib/security/authorization/authorization_policy_provider.h +1 -1
- data/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc +1 -1
- data/src/core/lib/security/authorization/evaluate_args.cc +6 -8
- data/src/core/lib/security/authorization/grpc_server_authz_filter.cc +5 -6
- data/src/core/lib/security/authorization/grpc_server_authz_filter.h +1 -0
- data/src/core/lib/security/authorization/matchers.cc +3 -3
- data/src/core/lib/security/certificate_provider/certificate_provider_factory.h +2 -2
- data/src/core/lib/security/certificate_provider/certificate_provider_registry.cc +2 -3
- data/src/core/lib/security/context/security_context.cc +12 -13
- data/src/core/lib/security/context/security_context.h +31 -8
- data/src/core/lib/security/credentials/alts/alts_credentials.h +1 -1
- data/src/core/lib/security/credentials/alts/check_gcp_environment.cc +3 -1
- data/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc +2 -3
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc +5 -5
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc +3 -3
- data/src/core/lib/security/credentials/call_creds_util.cc +2 -1
- data/src/core/lib/security/credentials/channel_creds_registry.h +2 -2
- data/src/core/lib/security/credentials/channel_creds_registry_init.cc +5 -3
- data/src/core/lib/security/credentials/composite/composite_credentials.h +1 -1
- data/src/core/lib/security/credentials/credentials.cc +6 -6
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +4 -4
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +2 -2
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +9 -11
- data/src/core/lib/security/credentials/external/external_account_credentials.h +3 -3
- data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +2 -2
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +4 -4
- data/src/core/lib/security/credentials/external/url_external_account_credentials.h +1 -1
- data/src/core/lib/security/credentials/fake/fake_credentials.h +1 -1
- data/src/core/lib/security/credentials/google_default/credentials_generic.cc +3 -3
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +11 -11
- data/src/core/lib/security/credentials/google_default/google_default_credentials.h +1 -1
- data/src/core/lib/security/credentials/iam/iam_credentials.h +1 -1
- data/src/core/lib/security/credentials/jwt/json_token.cc +14 -15
- data/src/core/lib/security/credentials/jwt/json_token.h +1 -1
- data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +6 -5
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +1 -1
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +50 -54
- data/src/core/lib/security/credentials/jwt/jwt_verifier.h +1 -1
- data/src/core/lib/security/credentials/local/local_credentials.h +1 -1
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +12 -11
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +4 -4
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +6 -7
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +1 -3
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +15 -21
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +1 -1
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +21 -30
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +1 -1
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +1 -1
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +4 -4
- data/src/core/lib/security/credentials/tls/grpc_tls_crl_provider.cc +3 -5
- data/src/core/lib/security/credentials/tls/tls_credentials.cc +14 -16
- data/src/core/lib/security/credentials/tls/tls_utils.cc +4 -4
- data/src/core/lib/security/credentials/xds/xds_credentials.cc +1 -1
- data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +13 -16
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +15 -12
- data/src/core/lib/security/security_connector/load_system_roots_supported.cc +6 -6
- data/src/core/lib/security/security_connector/load_system_roots_windows.cc +1 -1
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +8 -12
- data/src/core/lib/security/security_connector/security_connector.cc +1 -4
- data/src/core/lib/security/security_connector/security_connector.h +1 -3
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +17 -19
- data/src/core/lib/security/security_connector/ssl_utils.cc +19 -21
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +29 -40
- data/src/core/lib/security/transport/auth_filters.h +1 -0
- data/src/core/lib/security/transport/client_auth_filter.cc +7 -13
- data/src/core/lib/security/transport/server_auth_filter.cc +3 -8
- data/src/core/lib/security/util/json_util.h +1 -1
- data/src/core/lib/slice/slice.h +1 -1
- data/src/core/lib/slice/slice_refcount.h +2 -4
- data/src/core/lib/slice/slice_string_helpers.cc +1 -1
- data/src/core/lib/surface/api_trace.h +1 -3
- data/src/core/lib/surface/call.cc +64 -3738
- data/src/core/lib/surface/call.h +41 -143
- data/src/core/lib/surface/call_log_batch.cc +1 -1
- data/src/core/lib/surface/call_utils.cc +276 -0
- data/src/core/lib/surface/call_utils.h +449 -0
- data/src/core/lib/surface/channel.cc +8 -3
- data/src/core/lib/surface/channel.h +10 -7
- data/src/core/lib/surface/channel_create.cc +14 -6
- data/src/core/lib/surface/channel_create.h +3 -2
- data/src/core/lib/surface/channel_init.cc +21 -77
- data/src/core/lib/surface/channel_init.h +19 -97
- data/src/core/lib/surface/client_call.cc +419 -0
- data/src/core/lib/surface/client_call.h +180 -0
- data/src/core/lib/surface/completion_queue.cc +28 -33
- data/src/core/lib/surface/completion_queue.h +0 -8
- data/src/core/lib/surface/filter_stack_call.cc +1157 -0
- data/src/core/lib/surface/filter_stack_call.h +369 -0
- data/src/core/lib/surface/init.cc +7 -6
- data/src/core/lib/surface/lame_client.cc +1 -1
- data/src/core/lib/surface/legacy_channel.cc +40 -27
- data/src/core/lib/surface/legacy_channel.h +9 -18
- data/src/core/lib/surface/server_call.cc +222 -0
- data/src/core/lib/surface/server_call.h +167 -0
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/bdp_estimator.cc +3 -5
- data/src/core/lib/transport/bdp_estimator.h +2 -4
- data/src/core/lib/transport/call_arena_allocator.h +9 -7
- data/src/core/lib/transport/call_destination.h +76 -0
- data/src/core/lib/transport/call_filters.cc +28 -10
- data/src/core/lib/transport/call_filters.h +128 -22
- data/src/core/lib/transport/call_spine.cc +5 -6
- data/src/core/lib/transport/call_spine.h +159 -334
- data/src/core/lib/transport/connectivity_state.cc +8 -10
- data/src/core/lib/transport/connectivity_state.h +0 -2
- data/src/core/lib/transport/interception_chain.cc +155 -0
- data/src/core/lib/transport/interception_chain.h +236 -0
- data/src/core/lib/transport/metadata_batch.h +10 -1
- data/src/core/lib/transport/metadata_info.h +1 -1
- data/src/core/lib/transport/transport.cc +3 -6
- data/src/core/lib/transport/transport.h +43 -40
- data/src/core/load_balancing/child_policy_handler.cc +8 -8
- data/src/core/load_balancing/endpoint_list.cc +5 -5
- data/src/core/load_balancing/endpoint_list.h +1 -1
- data/src/core/load_balancing/grpclb/client_load_reporting_filter.cc +1 -0
- data/src/core/load_balancing/grpclb/client_load_reporting_filter.h +1 -0
- data/src/core/load_balancing/grpclb/grpclb.cc +25 -29
- data/src/core/load_balancing/grpclb/grpclb_balancer_addresses.cc +1 -1
- data/src/core/load_balancing/grpclb/load_balancer_api.cc +3 -4
- data/src/core/load_balancing/health_check_client.cc +10 -13
- data/src/core/load_balancing/lb_policy.cc +5 -8
- data/src/core/load_balancing/lb_policy.h +19 -3
- data/src/core/load_balancing/lb_policy_factory.h +1 -1
- data/src/core/load_balancing/lb_policy_registry.cc +2 -3
- data/src/core/load_balancing/lb_policy_registry.h +1 -1
- data/src/core/load_balancing/oob_backend_metric.cc +2 -4
- data/src/core/load_balancing/outlier_detection/outlier_detection.cc +33 -35
- data/src/core/load_balancing/outlier_detection/outlier_detection.h +3 -3
- data/src/core/load_balancing/pick_first/pick_first.cc +65 -65
- data/src/core/load_balancing/priority/priority.cc +26 -28
- data/src/core/load_balancing/ring_hash/ring_hash.cc +11 -13
- data/src/core/load_balancing/ring_hash/ring_hash.h +3 -3
- data/src/core/load_balancing/rls/rls.cc +82 -82
- data/src/core/load_balancing/round_robin/round_robin.cc +17 -20
- data/src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc +54 -43
- data/src/core/load_balancing/weighted_target/weighted_target.cc +21 -24
- data/src/core/load_balancing/xds/cds.cc +14 -16
- data/src/core/load_balancing/xds/xds_cluster_impl.cc +16 -18
- data/src/core/load_balancing/xds/xds_cluster_manager.cc +15 -17
- data/src/core/load_balancing/xds/xds_override_host.cc +40 -41
- data/src/core/load_balancing/xds/xds_override_host.h +3 -3
- data/src/core/load_balancing/xds/xds_wrr_locality.cc +10 -12
- data/src/core/plugin_registry/grpc_plugin_registry.cc +5 -1
- data/src/core/resolver/binder/binder_resolver.cc +3 -2
- data/src/core/resolver/dns/c_ares/dns_resolver_ares.cc +3 -2
- data/src/core/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +1 -1
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper.cc +7 -14
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper.h +1 -5
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +1 -1
- data/src/core/resolver/dns/dns_resolver_plugin.cc +6 -5
- data/src/core/resolver/dns/event_engine/event_engine_client_channel_resolver.cc +4 -9
- data/src/core/resolver/dns/event_engine/service_config_helper.cc +5 -5
- data/src/core/resolver/dns/native/dns_resolver.cc +8 -9
- data/src/core/resolver/endpoint_addresses.cc +1 -1
- data/src/core/resolver/fake/fake_resolver.cc +1 -1
- data/src/core/resolver/fake/fake_resolver.h +1 -1
- data/src/core/resolver/google_c2p/google_c2p_resolver.cc +13 -14
- data/src/core/resolver/polling_resolver.cc +30 -35
- data/src/core/resolver/resolver.cc +2 -6
- data/src/core/resolver/resolver.h +0 -2
- data/src/core/resolver/resolver_registry.cc +6 -8
- data/src/core/resolver/sockaddr/sockaddr_resolver.cc +3 -3
- data/src/core/resolver/xds/xds_dependency_manager.cc +22 -23
- data/src/core/resolver/xds/xds_resolver.cc +13 -15
- data/src/core/server/server.cc +269 -389
- data/src/core/server/server.h +37 -19
- data/src/core/server/server_call_tracer_filter.cc +7 -14
- data/src/core/server/server_config_selector.h +1 -1
- data/src/core/server/server_config_selector_filter.cc +3 -3
- data/src/core/server/server_interface.h +2 -0
- data/src/core/server/xds_channel_stack_modifier.cc +1 -1
- data/src/core/server/xds_channel_stack_modifier.h +1 -1
- data/src/core/server/xds_server_config_fetcher.cc +1 -4
- data/src/core/service_config/service_config.h +1 -1
- data/src/core/service_config/service_config_call_data.h +13 -11
- data/src/core/service_config/service_config_channel_arg_filter.cc +6 -4
- data/src/core/service_config/service_config_impl.cc +5 -5
- data/src/core/service_config/service_config_impl.h +1 -1
- data/src/core/service_config/service_config_parser.cc +3 -6
- data/src/core/service_config/service_config_parser.h +1 -1
- data/src/core/{lib/channel → telemetry}/call_tracer.cc +20 -30
- data/src/core/{lib/channel → telemetry}/call_tracer.h +32 -9
- data/src/core/{lib/debug → telemetry}/histogram_view.cc +1 -1
- data/src/core/{lib/debug → telemetry}/histogram_view.h +3 -3
- data/src/core/telemetry/metrics.cc +178 -0
- data/src/core/telemetry/metrics.h +562 -0
- data/src/core/{lib/debug → telemetry}/stats.cc +1 -1
- data/src/core/{lib/debug → telemetry}/stats.h +5 -5
- data/src/core/{lib/debug → telemetry}/stats_data.cc +1 -1
- data/src/core/{lib/debug → telemetry}/stats_data.h +4 -4
- data/src/core/{lib/channel → telemetry}/tcp_tracer.h +3 -3
- data/src/core/tsi/alts/frame_protector/alts_frame_protector.cc +12 -13
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +25 -27
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +32 -33
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.cc +2 -1
- data/src/core/tsi/alts/handshaker/transport_security_common_api.cc +2 -1
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc +5 -4
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc +5 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc +1 -1
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +4 -3
- data/src/core/tsi/fake_transport_security.cc +14 -17
- data/src/core/tsi/local_transport_security.cc +6 -5
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +4 -4
- data/src/core/tsi/ssl_transport_security.cc +76 -81
- data/src/core/tsi/ssl_transport_security_utils.cc +74 -18
- data/src/core/tsi/ssl_transport_security_utils.h +11 -0
- data/src/core/tsi/transport_security.cc +0 -4
- data/src/core/tsi/transport_security.h +0 -2
- data/src/core/tsi/transport_security_interface.h +0 -4
- data/src/core/{lib/gpr → util}/alloc.h +3 -3
- data/src/core/{lib/gpr → util}/android/log.cc +0 -19
- data/src/core/{lib/gpr → util}/atm.cc +1 -1
- data/src/core/{ext/gcp/metadata_query.cc → util/gcp_metadata_query.cc} +25 -26
- data/src/core/{ext/gcp/metadata_query.h → util/gcp_metadata_query.h} +11 -11
- data/src/core/{lib/http → util/http_client}/format_request.cc +4 -3
- data/src/core/{lib/http → util/http_client}/format_request.h +6 -5
- data/src/core/{lib/http → util/http_client}/httpcli.cc +9 -10
- data/src/core/{lib/http → util/http_client}/httpcli.h +6 -5
- data/src/core/{lib/http → util/http_client}/httpcli_security_connector.cc +9 -9
- data/src/core/{lib/http → util/http_client}/httpcli_ssl_credentials.h +5 -4
- data/src/core/{lib/http → util/http_client}/parser.cc +4 -5
- data/src/core/{lib/http → util/http_client}/parser.h +5 -6
- data/src/core/{lib → util}/json/json.h +5 -4
- data/src/core/{lib → util}/json/json_args.h +5 -5
- data/src/core/{lib → util}/json/json_channel_args.h +6 -6
- data/src/core/{lib → util}/json/json_object_loader.cc +3 -2
- data/src/core/{lib → util}/json/json_object_loader.h +7 -7
- data/src/core/{lib → util}/json/json_reader.cc +3 -2
- data/src/core/{lib → util}/json/json_reader.h +6 -6
- data/src/core/{lib → util}/json/json_util.cc +4 -4
- data/src/core/{lib → util}/json/json_util.h +6 -6
- data/src/core/{lib → util}/json/json_writer.cc +3 -3
- data/src/core/{lib → util}/json/json_writer.h +6 -6
- data/src/core/{lib/gpr → util}/linux/log.cc +0 -45
- data/src/core/{lib/gpr → util}/log.cc +45 -12
- data/src/core/{lib/gpr → util}/msys/tmpfile.cc +2 -2
- data/src/core/{lib/gpr → util}/posix/cpu.cc +1 -1
- data/src/core/{lib/gpr → util}/posix/log.cc +0 -42
- data/src/core/{lib/gpr → util}/posix/time.cc +1 -1
- data/src/core/{lib/gpr → util}/posix/tmpfile.cc +2 -2
- data/src/core/{lib/gpr → util}/spinlock.h +3 -3
- data/src/core/{lib/gpr → util}/string.cc +2 -2
- data/src/core/{lib/gpr → util}/string.h +3 -3
- data/src/core/{lib/gpr → util}/time_precise.cc +1 -1
- data/src/core/{lib/gpr → util}/time_precise.h +3 -3
- data/src/core/{lib/gpr → util}/tmpfile.h +3 -3
- data/src/core/{lib/gpr → util}/useful.h +3 -3
- data/src/core/{lib/gpr → util}/windows/log.cc +1 -44
- data/src/core/{lib/gpr → util}/windows/string.cc +1 -1
- data/src/core/{lib/gpr → util}/windows/string_util.cc +1 -1
- data/src/core/{lib/gpr → util}/windows/time.cc +1 -1
- data/src/core/{lib/gpr → util}/windows/tmpfile.cc +1 -1
- data/src/core/xds/grpc/certificate_provider_store.cc +3 -3
- data/src/core/xds/grpc/certificate_provider_store.h +4 -4
- data/src/core/xds/grpc/file_watcher_certificate_provider_factory.cc +3 -3
- data/src/core/xds/grpc/file_watcher_certificate_provider_factory.h +3 -3
- data/src/core/xds/grpc/xds_audit_logger_registry.h +1 -1
- data/src/core/xds/grpc/xds_bootstrap_grpc.cc +5 -5
- data/src/core/xds/grpc/xds_bootstrap_grpc.h +3 -3
- data/src/core/xds/grpc/xds_certificate_provider.h +1 -1
- data/src/core/xds/grpc/xds_client_grpc.cc +27 -23
- data/src/core/xds/grpc/xds_client_grpc.h +2 -2
- data/src/core/xds/grpc/xds_cluster.cc +4 -5
- data/src/core/xds/grpc/xds_cluster.h +1 -1
- data/src/core/xds/grpc/xds_cluster_specifier_plugin.cc +2 -2
- data/src/core/xds/grpc/xds_cluster_specifier_plugin.h +1 -1
- data/src/core/xds/grpc/xds_common_types.cc +1 -1
- data/src/core/xds/grpc/xds_common_types.h +1 -1
- data/src/core/xds/grpc/xds_endpoint.cc +4 -5
- data/src/core/xds/grpc/xds_http_fault_filter.cc +2 -2
- data/src/core/xds/grpc/xds_http_filters.h +2 -2
- data/src/core/xds/grpc/xds_http_rbac_filter.cc +3 -3
- data/src/core/xds/grpc/xds_http_stateful_session_filter.cc +2 -2
- data/src/core/xds/grpc/xds_lb_policy_registry.h +1 -1
- data/src/core/xds/grpc/xds_listener.cc +4 -6
- data/src/core/xds/grpc/xds_route_config.cc +7 -8
- data/src/core/xds/grpc/xds_transport_grpc.cc +2 -2
- data/src/core/xds/grpc/xds_transport_grpc.h +1 -1
- data/src/core/xds/xds_client/xds_api.cc +5 -9
- data/src/core/xds/xds_client/xds_bootstrap.cc +1 -1
- data/src/core/xds/xds_client/xds_bootstrap.h +1 -1
- data/src/core/xds/xds_client/xds_client.cc +39 -45
- data/src/core/xds/xds_client/xds_client.h +0 -3
- data/src/core/xds/xds_client/xds_client_stats.cc +6 -6
- data/src/core/xds/xds_client/xds_client_stats.h +2 -2
- data/src/ruby/ext/grpc/rb_call.c +8 -1
- data/src/ruby/ext/grpc/rb_completion_queue.c +15 -32
- data/src/ruby/ext/grpc/rb_completion_queue.h +7 -1
- data/src/ruby/ext/grpc/rb_server.c +39 -22
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/base64/base64.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/bio/bio.c +12 -12
- data/third_party/boringssl-with-bazel/src/crypto/conf/conf.c +66 -41
- data/third_party/boringssl-with-bazel/src/crypto/dilithium/dilithium.c +1497 -0
- data/third_party/boringssl-with-bazel/src/crypto/dilithium/internal.h +58 -0
- data/third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c +10 -3
- data/third_party/boringssl-with-bazel/src/crypto/dsa/dsa_asn1.c +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/dsa/internal.h +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm.c +5 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/exponentiation.c +45 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/internal.h +33 -23
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/fips_shared_support.c +3 -6
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/internal.h +9 -4
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha512.c +6 -0
- data/third_party/boringssl-with-bazel/src/crypto/internal.h +7 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/internal.h +0 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509/v3_utl.c +49 -16
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_lu.c +0 -10
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vfy.c +7 -17
- data/third_party/boringssl-with-bazel/src/include/openssl/bio.h +8 -6
- data/third_party/boringssl-with-bazel/src/include/openssl/crypto.h +3 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/experimental/dilithium.h +125 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +0 -23
- data/third_party/boringssl-with-bazel/src/ssl/dtls_method.cc +1 -1
- data/third_party/boringssl-with-bazel/src/ssl/internal.h +4 -10
- metadata +95 -91
- data/src/core/ext/transport/chttp2/transport/http_trace.cc +0 -19
- data/src/core/ext/transport/chttp2/transport/http_trace.h +0 -24
- data/src/core/ext/transport/inproc/inproc_plugin.cc +0 -23
- data/src/core/handshaker/security/tsi_error.cc +0 -31
- data/src/core/handshaker/security/tsi_error.h +0 -30
- data/src/core/lib/channel/channel_stack_trace.cc +0 -19
- data/src/core/lib/channel/channel_stack_trace.h +0 -24
- data/src/core/lib/channel/context.h +0 -105
- data/src/core/lib/channel/metrics.cc +0 -334
- data/src/core/lib/channel/metrics.h +0 -365
- data/src/core/lib/event_engine/trace.cc +0 -25
- data/src/core/lib/iomgr/ev_windows.cc +0 -30
- data/src/core/lib/promise/trace.cc +0 -20
- data/src/core/lib/promise/trace.h +0 -24
- data/src/core/lib/resource_quota/trace.cc +0 -19
- data/src/core/lib/resource_quota/trace.h +0 -24
- data/src/core/lib/slice/slice_refcount.cc +0 -20
- data/src/core/lib/surface/api_trace.cc +0 -25
- data/src/core/lib/surface/call_trace.h +0 -24
- data/src/core/lib/surface/wait_for_cq_end_op.cc +0 -75
- data/src/core/lib/surface/wait_for_cq_end_op.h +0 -72
- data/src/core/lib/transport/batch_builder.cc +0 -172
- data/src/core/lib/transport/batch_builder.h +0 -474
- data/src/core/resolver/xds/xds_resolver_trace.cc +0 -25
- data/src/core/resolver/xds/xds_resolver_trace.h +0 -30
- data/third_party/boringssl-with-bazel/src/crypto/conf/conf_def.h +0 -122
- /data/src/core/{lib/gpr → util}/alloc.cc +0 -0
- /data/src/core/{lib/gpr → util}/iphone/cpu.cc +0 -0
- /data/src/core/{lib/gpr → util}/linux/cpu.cc +0 -0
- /data/src/core/{lib/gpr → util}/posix/string.cc +0 -0
- /data/src/core/{lib/gpr → util}/posix/sync.cc +0 -0
- /data/src/core/{lib/gpr → util}/sync.cc +0 -0
- /data/src/core/{lib/gpr → util}/sync_abseil.cc +0 -0
- /data/src/core/{lib/gpr → util}/time.cc +0 -0
- /data/src/core/{lib/gpr → util}/windows/cpu.cc +0 -0
- /data/src/core/{lib/gpr → util}/windows/sync.cc +0 -0
@@ -46,6 +46,7 @@
|
|
46
46
|
#include <unordered_map>
|
47
47
|
|
48
48
|
#include "absl/log/check.h"
|
49
|
+
#include "absl/log/log.h"
|
49
50
|
|
50
51
|
#include <grpc/slice.h>
|
51
52
|
#include <grpc/support/alloc.h>
|
@@ -56,12 +57,8 @@
|
|
56
57
|
|
57
58
|
#include "src/core/lib/address_utils/sockaddr_utils.h"
|
58
59
|
#include "src/core/lib/debug/event_log.h"
|
59
|
-
#include "src/core/lib/debug/stats.h"
|
60
|
-
#include "src/core/lib/debug/stats_data.h"
|
61
60
|
#include "src/core/lib/debug/trace.h"
|
62
61
|
#include "src/core/lib/experiments/experiments.h"
|
63
|
-
#include "src/core/lib/gpr/string.h"
|
64
|
-
#include "src/core/lib/gpr/useful.h"
|
65
62
|
#include "src/core/lib/gprpp/crash.h"
|
66
63
|
#include "src/core/lib/gprpp/strerror.h"
|
67
64
|
#include "src/core/lib/gprpp/sync.h"
|
@@ -74,9 +71,12 @@
|
|
74
71
|
#include "src/core/lib/iomgr/tcp_posix.h"
|
75
72
|
#include "src/core/lib/resource_quota/api.h"
|
76
73
|
#include "src/core/lib/resource_quota/memory_quota.h"
|
77
|
-
#include "src/core/lib/resource_quota/trace.h"
|
78
74
|
#include "src/core/lib/slice/slice_internal.h"
|
79
75
|
#include "src/core/lib/slice/slice_string_helpers.h"
|
76
|
+
#include "src/core/telemetry/stats.h"
|
77
|
+
#include "src/core/telemetry/stats_data.h"
|
78
|
+
#include "src/core/util/string.h"
|
79
|
+
#include "src/core/util/useful.h"
|
80
80
|
|
81
81
|
#ifndef SOL_TCP
|
82
82
|
#define SOL_TCP IPPROTO_TCP
|
@@ -108,8 +108,6 @@ typedef GRPC_MSG_IOVLEN_TYPE msg_iovlen_type;
|
|
108
108
|
typedef size_t msg_iovlen_type;
|
109
109
|
#endif
|
110
110
|
|
111
|
-
extern grpc_core::TraceFlag grpc_tcp_trace;
|
112
|
-
|
113
111
|
namespace grpc_core {
|
114
112
|
|
115
113
|
class TcpZerocopySendRecord {
|
@@ -212,7 +210,7 @@ class TcpZerocopySendCtx {
|
|
212
210
|
if (send_records_ == nullptr || free_send_records_ == nullptr) {
|
213
211
|
gpr_free(send_records_);
|
214
212
|
gpr_free(free_send_records_);
|
215
|
-
|
213
|
+
LOG(INFO) << "Disabling TCP TX zerocopy due to memory pressure.\n";
|
216
214
|
memory_limited_ = true;
|
217
215
|
} else {
|
218
216
|
for (int idx = 0; idx < max_sends_; ++idx) {
|
@@ -620,7 +618,7 @@ static void tcp_drop_uncovered_then_handle_write(void* arg /* grpc_tcp */,
|
|
620
618
|
|
621
619
|
static void done_poller(void* bp, grpc_error_handle /*error_ignored*/) {
|
622
620
|
backup_poller* p = static_cast<backup_poller*>(bp);
|
623
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
621
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
624
622
|
gpr_log(GPR_INFO, "BACKUP_POLLER:%p destroy", p);
|
625
623
|
}
|
626
624
|
grpc_pollset_destroy(BACKUP_POLLER_POLLSET(p));
|
@@ -629,7 +627,7 @@ static void done_poller(void* bp, grpc_error_handle /*error_ignored*/) {
|
|
629
627
|
|
630
628
|
static void run_poller(void* bp, grpc_error_handle /*error_ignored*/) {
|
631
629
|
backup_poller* p = static_cast<backup_poller*>(bp);
|
632
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
630
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
633
631
|
gpr_log(GPR_INFO, "BACKUP_POLLER:%p run", p);
|
634
632
|
}
|
635
633
|
gpr_mu_lock(p->pollset_mu);
|
@@ -646,7 +644,7 @@ static void run_poller(void* bp, grpc_error_handle /*error_ignored*/) {
|
|
646
644
|
g_backup_poller = nullptr;
|
647
645
|
g_uncovered_notifications_pending = 0;
|
648
646
|
g_backup_poller_mu->Unlock();
|
649
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
647
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
650
648
|
gpr_log(GPR_INFO, "BACKUP_POLLER:%p shutdown", p);
|
651
649
|
}
|
652
650
|
grpc_pollset_shutdown(BACKUP_POLLER_POLLSET(p),
|
@@ -654,7 +652,7 @@ static void run_poller(void* bp, grpc_error_handle /*error_ignored*/) {
|
|
654
652
|
grpc_schedule_on_exec_ctx));
|
655
653
|
} else {
|
656
654
|
g_backup_poller_mu->Unlock();
|
657
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
655
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
658
656
|
gpr_log(GPR_INFO, "BACKUP_POLLER:%p reschedule", p);
|
659
657
|
}
|
660
658
|
grpc_core::Executor::Run(&p->run_poller, absl::OkStatus(),
|
@@ -671,7 +669,7 @@ static void drop_uncovered(grpc_tcp* /*tcp*/) {
|
|
671
669
|
old_count = g_uncovered_notifications_pending--;
|
672
670
|
g_backup_poller_mu->Unlock();
|
673
671
|
CHECK_GT(old_count, 1);
|
674
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
672
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
675
673
|
gpr_log(GPR_INFO, "BACKUP_POLLER:%p uncover cnt %d->%d", p, old_count,
|
676
674
|
old_count - 1);
|
677
675
|
}
|
@@ -695,7 +693,7 @@ static void cover_self(grpc_tcp* tcp) {
|
|
695
693
|
g_backup_poller = p;
|
696
694
|
grpc_pollset_init(BACKUP_POLLER_POLLSET(p), &p->pollset_mu);
|
697
695
|
g_backup_poller_mu->Unlock();
|
698
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
696
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
699
697
|
gpr_log(GPR_INFO, "BACKUP_POLLER:%p create", p);
|
700
698
|
}
|
701
699
|
grpc_core::Executor::Run(
|
@@ -707,7 +705,7 @@ static void cover_self(grpc_tcp* tcp) {
|
|
707
705
|
p = g_backup_poller;
|
708
706
|
g_backup_poller_mu->Unlock();
|
709
707
|
}
|
710
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
708
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
711
709
|
gpr_log(GPR_INFO, "BACKUP_POLLER:%p add %p cnt %d->%d", p, tcp,
|
712
710
|
old_count - 1, old_count);
|
713
711
|
}
|
@@ -715,14 +713,14 @@ static void cover_self(grpc_tcp* tcp) {
|
|
715
713
|
}
|
716
714
|
|
717
715
|
static void notify_on_read(grpc_tcp* tcp) {
|
718
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
716
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
719
717
|
gpr_log(GPR_INFO, "TCP:%p notify_on_read", tcp);
|
720
718
|
}
|
721
719
|
grpc_fd_notify_on_read(tcp->em_fd, &tcp->read_done_closure);
|
722
720
|
}
|
723
721
|
|
724
722
|
static void notify_on_write(grpc_tcp* tcp) {
|
725
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
723
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
726
724
|
gpr_log(GPR_INFO, "TCP:%p notify_on_write", tcp);
|
727
725
|
}
|
728
726
|
if (!grpc_event_engine_run_in_background()) {
|
@@ -733,7 +731,7 @@ static void notify_on_write(grpc_tcp* tcp) {
|
|
733
731
|
|
734
732
|
static void tcp_drop_uncovered_then_handle_write(void* arg,
|
735
733
|
grpc_error_handle error) {
|
736
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
734
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
737
735
|
gpr_log(GPR_INFO, "TCP:%p got_write: %s", arg,
|
738
736
|
grpc_core::StatusToString(error).c_str());
|
739
737
|
}
|
@@ -761,28 +759,16 @@ static void finish_estimate(grpc_tcp* tcp) {
|
|
761
759
|
|
762
760
|
static grpc_error_handle tcp_annotate_error(grpc_error_handle src_error,
|
763
761
|
grpc_tcp* tcp) {
|
764
|
-
return
|
765
|
-
grpc_error_set_int(
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
// choose to retry.
|
770
|
-
grpc_core::StatusIntProperty::kRpcStatus, GRPC_STATUS_UNAVAILABLE),
|
771
|
-
grpc_core::StatusStrProperty::kTargetAddress, tcp->peer_string);
|
762
|
+
return grpc_error_set_int(
|
763
|
+
grpc_error_set_int(src_error, grpc_core::StatusIntProperty::kFd, tcp->fd),
|
764
|
+
// All tcp errors are marked with UNAVAILABLE so that application may
|
765
|
+
// choose to retry.
|
766
|
+
grpc_core::StatusIntProperty::kRpcStatus, GRPC_STATUS_UNAVAILABLE);
|
772
767
|
}
|
773
768
|
|
774
769
|
static void tcp_handle_read(void* arg /* grpc_tcp */, grpc_error_handle error);
|
775
770
|
static void tcp_handle_write(void* arg /* grpc_tcp */, grpc_error_handle error);
|
776
771
|
|
777
|
-
static void tcp_shutdown(grpc_endpoint* ep, grpc_error_handle why) {
|
778
|
-
grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
|
779
|
-
ZerocopyDisableAndWaitForRemaining(tcp);
|
780
|
-
grpc_fd_shutdown(tcp->em_fd, why);
|
781
|
-
tcp->read_mu.Lock();
|
782
|
-
tcp->memory_owner.Reset();
|
783
|
-
tcp->read_mu.Unlock();
|
784
|
-
}
|
785
|
-
|
786
772
|
static void tcp_free(grpc_tcp* tcp) {
|
787
773
|
grpc_fd_orphan(tcp->em_fd, tcp->release_fd_cb, tcp->release_fd,
|
788
774
|
"tcp_unref_orphan");
|
@@ -820,10 +806,11 @@ static void tcp_ref(grpc_tcp* tcp) { tcp->refcount.Ref(); }
|
|
820
806
|
#endif
|
821
807
|
|
822
808
|
static void tcp_destroy(grpc_endpoint* ep) {
|
809
|
+
gpr_log(GPR_INFO, "IOMGR endpoint shutdown");
|
823
810
|
grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
|
824
|
-
|
811
|
+
ZerocopyDisableAndWaitForRemaining(tcp);
|
812
|
+
grpc_fd_shutdown(tcp->em_fd, absl::UnavailableError("endpoint shutdown"));
|
825
813
|
if (grpc_event_engine_can_track_errors()) {
|
826
|
-
ZerocopyDisableAndWaitForRemaining(tcp);
|
827
814
|
gpr_atm_no_barrier_store(&tcp->stop_error_notification, true);
|
828
815
|
grpc_fd_set_error(tcp->em_fd);
|
829
816
|
}
|
@@ -835,8 +822,8 @@ static void tcp_destroy(grpc_endpoint* ep) {
|
|
835
822
|
|
836
823
|
static void perform_reclamation(grpc_tcp* tcp)
|
837
824
|
ABSL_LOCKS_EXCLUDED(tcp->read_mu) {
|
838
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
839
|
-
|
825
|
+
if (GRPC_TRACE_FLAG_ENABLED(resource_quota)) {
|
826
|
+
LOG(INFO) << "TCP: benign reclamation to free memory";
|
840
827
|
}
|
841
828
|
tcp->read_mu.Lock();
|
842
829
|
if (tcp->incoming_buffer != nullptr) {
|
@@ -865,16 +852,16 @@ static void maybe_post_reclaimer(grpc_tcp* tcp)
|
|
865
852
|
static void tcp_trace_read(grpc_tcp* tcp, grpc_error_handle error)
|
866
853
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(tcp->read_mu) {
|
867
854
|
grpc_closure* cb = tcp->read_cb;
|
868
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
855
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
869
856
|
gpr_log(GPR_INFO, "TCP:%p call_cb %p %p:%p", tcp, cb, cb->cb, cb->cb_arg);
|
870
857
|
size_t i;
|
871
858
|
gpr_log(GPR_INFO, "READ %p (peer=%s) error=%s", tcp,
|
872
859
|
tcp->peer_string.c_str(), grpc_core::StatusToString(error).c_str());
|
873
|
-
if (
|
860
|
+
if (ABSL_VLOG_IS_ON(2)) {
|
874
861
|
for (i = 0; i < tcp->incoming_buffer->count; i++) {
|
875
862
|
char* dump = grpc_dump_slice(tcp->incoming_buffer->slices[i],
|
876
863
|
GPR_DUMP_HEX | GPR_DUMP_ASCII);
|
877
|
-
|
864
|
+
VLOG(2) << "READ DATA: " << dump;
|
878
865
|
gpr_free(dump);
|
879
866
|
}
|
880
867
|
}
|
@@ -930,7 +917,7 @@ static void update_rcvlowat(grpc_tcp* tcp)
|
|
930
917
|
#define MAX_READ_IOVEC 64
|
931
918
|
static bool tcp_do_read(grpc_tcp* tcp, grpc_error_handle* error)
|
932
919
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(tcp->read_mu) {
|
933
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
920
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
934
921
|
gpr_log(GPR_INFO, "TCP:%p do_read", tcp);
|
935
922
|
}
|
936
923
|
struct msghdr msg;
|
@@ -1143,7 +1130,7 @@ static void maybe_make_read_slices(grpc_tcp* tcp)
|
|
1143
1130
|
|
1144
1131
|
static void tcp_handle_read(void* arg /* grpc_tcp */, grpc_error_handle error) {
|
1145
1132
|
grpc_tcp* tcp = static_cast<grpc_tcp*>(arg);
|
1146
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
1133
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
1147
1134
|
gpr_log(GPR_INFO, "TCP:%p got_read: %s", tcp,
|
1148
1135
|
grpc_core::StatusToString(error).c_str());
|
1149
1136
|
}
|
@@ -1293,8 +1280,8 @@ static bool tcp_write_with_timestamps(grpc_tcp* tcp, struct msghdr* msg,
|
|
1293
1280
|
uint32_t opt = grpc_core::kTimestampingSocketOptions;
|
1294
1281
|
if (setsockopt(tcp->fd, SOL_SOCKET, SO_TIMESTAMPING,
|
1295
1282
|
static_cast<void*>(&opt), sizeof(opt)) != 0) {
|
1296
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
1297
|
-
|
1283
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
1284
|
+
LOG(ERROR) << "Failed to set timestamping options on the socket.";
|
1298
1285
|
}
|
1299
1286
|
return false;
|
1300
1287
|
}
|
@@ -1379,8 +1366,8 @@ struct cmsghdr* process_timestamp(grpc_tcp* tcp, msghdr* msg,
|
|
1379
1366
|
auto next_cmsg = CMSG_NXTHDR(msg, cmsg);
|
1380
1367
|
cmsghdr* opt_stats = nullptr;
|
1381
1368
|
if (next_cmsg == nullptr) {
|
1382
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
1383
|
-
|
1369
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
1370
|
+
LOG(ERROR) << "Received timestamp without extended error";
|
1384
1371
|
}
|
1385
1372
|
return cmsg;
|
1386
1373
|
}
|
@@ -1391,8 +1378,8 @@ struct cmsghdr* process_timestamp(grpc_tcp* tcp, msghdr* msg,
|
|
1391
1378
|
opt_stats = next_cmsg;
|
1392
1379
|
next_cmsg = CMSG_NXTHDR(msg, opt_stats);
|
1393
1380
|
if (next_cmsg == nullptr) {
|
1394
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
1395
|
-
|
1381
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
1382
|
+
LOG(ERROR) << "Received timestamp without extended error";
|
1396
1383
|
}
|
1397
1384
|
return opt_stats;
|
1398
1385
|
}
|
@@ -1401,8 +1388,8 @@ struct cmsghdr* process_timestamp(grpc_tcp* tcp, msghdr* msg,
|
|
1401
1388
|
if (!(next_cmsg->cmsg_level == SOL_IP || next_cmsg->cmsg_level == SOL_IPV6) ||
|
1402
1389
|
!(next_cmsg->cmsg_type == IP_RECVERR ||
|
1403
1390
|
next_cmsg->cmsg_type == IPV6_RECVERR)) {
|
1404
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
1405
|
-
|
1391
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
1392
|
+
LOG(ERROR) << "Unexpected control message";
|
1406
1393
|
}
|
1407
1394
|
return cmsg;
|
1408
1395
|
}
|
@@ -1412,7 +1399,7 @@ struct cmsghdr* process_timestamp(grpc_tcp* tcp, msghdr* msg,
|
|
1412
1399
|
auto serr = reinterpret_cast<struct sock_extended_err*>(CMSG_DATA(next_cmsg));
|
1413
1400
|
if (serr->ee_errno != ENOMSG ||
|
1414
1401
|
serr->ee_origin != SO_EE_ORIGIN_TIMESTAMPING) {
|
1415
|
-
|
1402
|
+
LOG(ERROR) << "Unexpected control message";
|
1416
1403
|
return cmsg;
|
1417
1404
|
}
|
1418
1405
|
tcp->tb_list.ProcessTimestamp(serr, opt_stats, tss);
|
@@ -1462,7 +1449,7 @@ static bool process_errors(grpc_tcp* tcp) {
|
|
1462
1449
|
return processed_err;
|
1463
1450
|
}
|
1464
1451
|
if (GPR_UNLIKELY((msg.msg_flags & MSG_CTRUNC) != 0)) {
|
1465
|
-
|
1452
|
+
LOG(ERROR) << "Error message was truncated.";
|
1466
1453
|
}
|
1467
1454
|
|
1468
1455
|
if (msg.msg_controllen == 0) {
|
@@ -1484,7 +1471,7 @@ static bool process_errors(grpc_tcp* tcp) {
|
|
1484
1471
|
} else {
|
1485
1472
|
// Got a control message that is not a timestamp or zerocopy. Don't know
|
1486
1473
|
// how to handle this.
|
1487
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
1474
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
1488
1475
|
gpr_log(GPR_INFO,
|
1489
1476
|
"unknown control message cmsg_level:%d cmsg_type:%d",
|
1490
1477
|
cmsg->cmsg_level, cmsg->cmsg_type);
|
@@ -1501,7 +1488,7 @@ static bool process_errors(grpc_tcp* tcp) {
|
|
1501
1488
|
static void tcp_handle_error(void* arg /* grpc_tcp */,
|
1502
1489
|
grpc_error_handle error) {
|
1503
1490
|
grpc_tcp* tcp = static_cast<grpc_tcp*>(arg);
|
1504
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
1491
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
1505
1492
|
gpr_log(GPR_INFO, "TCP:%p got_error: %s", tcp,
|
1506
1493
|
grpc_core::StatusToString(error).c_str());
|
1507
1494
|
}
|
@@ -1539,14 +1526,14 @@ static bool tcp_write_with_timestamps(grpc_tcp* /*tcp*/, struct msghdr* /*msg*/,
|
|
1539
1526
|
ssize_t* /*sent_length*/,
|
1540
1527
|
int* /* saved_errno */,
|
1541
1528
|
int /*additional_flags*/) {
|
1542
|
-
|
1529
|
+
LOG(ERROR) << "Write with timestamps not supported for this platform";
|
1543
1530
|
CHECK(0);
|
1544
1531
|
return false;
|
1545
1532
|
}
|
1546
1533
|
|
1547
1534
|
static void tcp_handle_error(void* /*arg*/ /* grpc_tcp */,
|
1548
1535
|
grpc_error_handle /*error*/) {
|
1549
|
-
|
1536
|
+
LOG(ERROR) << "Error handling is not supported for this platform";
|
1550
1537
|
CHECK(0);
|
1551
1538
|
}
|
1552
1539
|
#endif // GRPC_LINUX_ERRQUEUE
|
@@ -1667,10 +1654,6 @@ static bool do_tcp_flush_zerocopy(grpc_tcp* tcp, TcpZerocopySendRecord* record,
|
|
1667
1654
|
if (saved_errno == EAGAIN || saved_errno == ENOBUFS) {
|
1668
1655
|
record->UnwindIfThrottled(unwind_slice_idx, unwind_byte_idx);
|
1669
1656
|
return false;
|
1670
|
-
} else if (saved_errno == EPIPE) {
|
1671
|
-
*error = tcp_annotate_error(GRPC_OS_ERROR(saved_errno, "sendmsg"), tcp);
|
1672
|
-
tcp_shutdown_buffer_list(tcp);
|
1673
|
-
return true;
|
1674
1657
|
} else {
|
1675
1658
|
*error = tcp_annotate_error(GRPC_OS_ERROR(saved_errno, "sendmsg"), tcp);
|
1676
1659
|
tcp_shutdown_buffer_list(tcp);
|
@@ -1781,11 +1764,6 @@ static bool tcp_flush(grpc_tcp* tcp, grpc_error_handle* error) {
|
|
1781
1764
|
grpc_slice_buffer_remove_first(tcp->outgoing_buffer);
|
1782
1765
|
}
|
1783
1766
|
return false;
|
1784
|
-
} else if (saved_errno == EPIPE) {
|
1785
|
-
*error = tcp_annotate_error(GRPC_OS_ERROR(saved_errno, "sendmsg"), tcp);
|
1786
|
-
grpc_slice_buffer_reset_and_unref(tcp->outgoing_buffer);
|
1787
|
-
tcp_shutdown_buffer_list(tcp);
|
1788
|
-
return true;
|
1789
1767
|
} else {
|
1790
1768
|
*error = tcp_annotate_error(GRPC_OS_ERROR(saved_errno, "sendmsg"), tcp);
|
1791
1769
|
grpc_slice_buffer_reset_and_unref(tcp->outgoing_buffer);
|
@@ -1841,8 +1819,8 @@ static void tcp_handle_write(void* arg /* grpc_tcp */,
|
|
1841
1819
|
? tcp_flush_zerocopy(tcp, tcp->current_zerocopy_send, &error)
|
1842
1820
|
: tcp_flush(tcp, &error);
|
1843
1821
|
if (!flush_result) {
|
1844
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
1845
|
-
|
1822
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
1823
|
+
LOG(INFO) << "write: delayed";
|
1846
1824
|
}
|
1847
1825
|
notify_on_write(tcp);
|
1848
1826
|
// tcp_flush does not populate error if it has returned false.
|
@@ -1851,9 +1829,7 @@ static void tcp_handle_write(void* arg /* grpc_tcp */,
|
|
1851
1829
|
cb = tcp->write_cb;
|
1852
1830
|
tcp->write_cb = nullptr;
|
1853
1831
|
tcp->current_zerocopy_send = nullptr;
|
1854
|
-
|
1855
|
-
gpr_log(GPR_INFO, "write: %s", grpc_core::StatusToString(error).c_str());
|
1856
|
-
}
|
1832
|
+
GRPC_TRACE_LOG(tcp, INFO) << "write: " << grpc_core::StatusToString(error);
|
1857
1833
|
// No need to take a ref on error since tcp_flush provides a ref.
|
1858
1834
|
grpc_core::Closure::Run(DEBUG_LOCATION, cb, error);
|
1859
1835
|
TCP_UNREF(tcp, "write");
|
@@ -1868,15 +1844,15 @@ static void tcp_write(grpc_endpoint* ep, grpc_slice_buffer* buf,
|
|
1868
1844
|
|
1869
1845
|
grpc_core::EventLog::Append("tcp-write-outstanding", buf->length);
|
1870
1846
|
|
1871
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
1847
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
1872
1848
|
size_t i;
|
1873
1849
|
|
1874
1850
|
for (i = 0; i < buf->count; i++) {
|
1875
1851
|
gpr_log(GPR_INFO, "WRITE %p (peer=%s)", tcp, tcp->peer_string.c_str());
|
1876
|
-
if (
|
1852
|
+
if (ABSL_VLOG_IS_ON(2)) {
|
1877
1853
|
char* data =
|
1878
1854
|
grpc_dump_slice(buf->slices[i], GPR_DUMP_HEX | GPR_DUMP_ASCII);
|
1879
|
-
|
1855
|
+
VLOG(2) << "WRITE DATA: " << data;
|
1880
1856
|
gpr_free(data);
|
1881
1857
|
}
|
1882
1858
|
}
|
@@ -1914,14 +1890,12 @@ static void tcp_write(grpc_endpoint* ep, grpc_slice_buffer* buf,
|
|
1914
1890
|
TCP_REF(tcp, "write");
|
1915
1891
|
tcp->write_cb = cb;
|
1916
1892
|
tcp->current_zerocopy_send = zerocopy_send_record;
|
1917
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
1918
|
-
|
1893
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
1894
|
+
LOG(INFO) << "write: delayed";
|
1919
1895
|
}
|
1920
1896
|
notify_on_write(tcp);
|
1921
1897
|
} else {
|
1922
|
-
|
1923
|
-
gpr_log(GPR_INFO, "write: %s", grpc_core::StatusToString(error).c_str());
|
1924
|
-
}
|
1898
|
+
GRPC_TRACE_LOG(tcp, INFO) << "write: " << grpc_core::StatusToString(error);
|
1925
1899
|
grpc_core::Closure::Run(DEBUG_LOCATION, cb, error);
|
1926
1900
|
}
|
1927
1901
|
}
|
@@ -1976,7 +1950,6 @@ static const grpc_endpoint_vtable vtable = {tcp_read,
|
|
1976
1950
|
tcp_add_to_pollset,
|
1977
1951
|
tcp_add_to_pollset_set,
|
1978
1952
|
tcp_delete_from_pollset_set,
|
1979
|
-
tcp_shutdown,
|
1980
1953
|
tcp_destroy,
|
1981
1954
|
tcp_get_peer,
|
1982
1955
|
tcp_get_local_address,
|
@@ -2029,13 +2002,13 @@ grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd,
|
|
2029
2002
|
if (err == 0) {
|
2030
2003
|
tcp->tcp_zerocopy_send_ctx.set_enabled(true);
|
2031
2004
|
} else {
|
2032
|
-
|
2005
|
+
LOG(ERROR) << "Failed to set zerocopy options on the socket.";
|
2033
2006
|
}
|
2034
2007
|
#endif
|
2035
2008
|
}
|
2036
2009
|
// paired with unref in grpc_tcp_destroy
|
2037
|
-
new (&tcp->refcount)
|
2038
|
-
1, GRPC_TRACE_FLAG_ENABLED(
|
2010
|
+
new (&tcp->refcount)
|
2011
|
+
grpc_core::RefCount(1, GRPC_TRACE_FLAG_ENABLED(tcp) ? "tcp" : nullptr);
|
2039
2012
|
gpr_atm_no_barrier_store(&tcp->shutdown_count, 0);
|
2040
2013
|
tcp->em_fd = em_fd;
|
2041
2014
|
grpc_slice_buffer_init(&tcp->last_read_buffer);
|
@@ -38,8 +38,6 @@
|
|
38
38
|
#include "src/core/lib/iomgr/port.h"
|
39
39
|
#include "src/core/lib/iomgr/socket_utils_posix.h"
|
40
40
|
|
41
|
-
extern grpc_core::TraceFlag grpc_tcp_trace;
|
42
|
-
|
43
41
|
/// Create a tcp endpoint given a file desciptor and a read slice size.
|
44
42
|
/// Takes ownership of \a fd. Takes ownership of the \a slice_allocator.
|
45
43
|
grpc_endpoint* grpc_tcp_create(grpc_fd* fd,
|
@@ -177,7 +177,7 @@ static grpc_error_handle CreateEventEngineListener(
|
|
177
177
|
addr_uri.status().ToString().c_str());
|
178
178
|
return;
|
179
179
|
}
|
180
|
-
if (
|
180
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
181
181
|
gpr_log(GPR_INFO,
|
182
182
|
"SERVER_CONNECT: incoming external connection: %s",
|
183
183
|
addr_uri->c_str());
|
@@ -467,7 +467,7 @@ static void on_read(void* arg, grpc_error_handle err) {
|
|
467
467
|
addr_uri.status().ToString().c_str());
|
468
468
|
goto error;
|
469
469
|
}
|
470
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
470
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
471
471
|
gpr_log(GPR_INFO, "SERVER_CONNECT: incoming connection: %s",
|
472
472
|
addr_uri->c_str());
|
473
473
|
}
|
@@ -928,7 +928,7 @@ class ExternalConnectionHandler : public grpc_core::TcpServerFdHandler {
|
|
928
928
|
addr_uri.status().ToString().c_str());
|
929
929
|
return;
|
930
930
|
}
|
931
|
-
if (
|
931
|
+
if (GRPC_TRACE_FLAG_ENABLED(tcp)) {
|
932
932
|
gpr_log(GPR_INFO, "SERVER_CONNECT: incoming external connection: %s",
|
933
933
|
addr_uri->c_str());
|
934
934
|
}
|
@@ -32,10 +32,10 @@
|
|
32
32
|
#include <string>
|
33
33
|
|
34
34
|
#include "absl/log/check.h"
|
35
|
+
#include "absl/log/log.h"
|
35
36
|
#include "absl/strings/str_cat.h"
|
36
37
|
|
37
38
|
#include <grpc/support/alloc.h>
|
38
|
-
#include <grpc/support/log.h>
|
39
39
|
#include <grpc/support/sync.h>
|
40
40
|
|
41
41
|
#include "src/core/lib/address_utils/sockaddr_utils.h"
|
@@ -72,10 +72,8 @@ static void init_max_accept_queue_size(void) {
|
|
72
72
|
s_max_accept_queue_size = n;
|
73
73
|
|
74
74
|
if (s_max_accept_queue_size < MIN_SAFE_ACCEPT_QUEUE_SIZE) {
|
75
|
-
|
76
|
-
|
77
|
-
"connection drops",
|
78
|
-
s_max_accept_queue_size);
|
75
|
+
LOG(INFO) << "Suspiciously small accept queue (" << s_max_accept_queue_size
|
76
|
+
<< ") will probably lead to connection drops";
|
79
77
|
}
|
80
78
|
}
|
81
79
|
|
@@ -221,7 +219,7 @@ grpc_error_handle grpc_tcp_server_prepare_socket(
|
|
221
219
|
err = grpc_set_socket_zerocopy(fd);
|
222
220
|
if (!err.ok()) {
|
223
221
|
// it's not fatal, so just log it.
|
224
|
-
|
222
|
+
VLOG(2) << "Node does not support SO_ZEROCOPY, continuing.";
|
225
223
|
}
|
226
224
|
#endif
|
227
225
|
err = grpc_set_socket_nonblocking(fd, 1);
|
@@ -31,10 +31,10 @@
|
|
31
31
|
#include <string>
|
32
32
|
|
33
33
|
#include "absl/log/check.h"
|
34
|
+
#include "absl/log/log.h"
|
34
35
|
#include "absl/strings/str_cat.h"
|
35
36
|
|
36
37
|
#include <grpc/support/alloc.h>
|
37
|
-
#include <grpc/support/log.h>
|
38
38
|
|
39
39
|
#include "src/core/lib/address_utils/sockaddr_utils.h"
|
40
40
|
#include "src/core/lib/gprpp/crash.h"
|
@@ -115,7 +115,7 @@ grpc_error_handle grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s,
|
|
115
115
|
} else if (requested_port <= 0) {
|
116
116
|
return GRPC_ERROR_CREATE("Bad get_unused_port()");
|
117
117
|
}
|
118
|
-
|
118
|
+
VLOG(2) << "Picked unused port " << requested_port;
|
119
119
|
}
|
120
120
|
|
121
121
|
static bool v4_available = grpc_is_ipv4_availabile();
|
@@ -150,14 +150,14 @@ grpc_error_handle grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s,
|
|
150
150
|
if (!addr_str.ok()) {
|
151
151
|
return GRPC_ERROR_CREATE(addr_str.status().ToString());
|
152
152
|
}
|
153
|
-
|
154
|
-
|
155
|
-
|
153
|
+
VLOG(2) << absl::StrFormat(
|
154
|
+
"Adding local addr from interface %s flags 0x%x to server: %s",
|
155
|
+
ifa_name, ifa_it->ifa_flags, addr_str->c_str());
|
156
156
|
// We could have multiple interfaces with the same address (e.g., bonding),
|
157
157
|
// so look for duplicates.
|
158
158
|
if (find_listener_with_addr(s, &addr) != nullptr) {
|
159
|
-
|
160
|
-
|
159
|
+
VLOG(2) << "Skipping duplicate addr " << *addr_str << " on interface "
|
160
|
+
<< ifa_name;
|
161
161
|
continue;
|
162
162
|
}
|
163
163
|
if ((err = grpc_tcp_server_add_addr(s, &addr, port_index, fd_index, &dsmode,
|
@@ -28,13 +28,13 @@
|
|
28
28
|
#include <vector>
|
29
29
|
|
30
30
|
#include "absl/log/check.h"
|
31
|
+
#include "absl/log/log.h"
|
31
32
|
#include "absl/strings/str_cat.h"
|
32
33
|
|
33
34
|
#include <grpc/event_engine/endpoint_config.h>
|
34
35
|
#include <grpc/event_engine/event_engine.h>
|
35
36
|
#include <grpc/event_engine/memory_allocator.h>
|
36
37
|
#include <grpc/support/alloc.h>
|
37
|
-
#include <grpc/support/log.h>
|
38
38
|
#include <grpc/support/log_windows.h>
|
39
39
|
#include <grpc/support/string_util.h>
|
40
40
|
#include <grpc/support/sync.h>
|
@@ -294,14 +294,9 @@ static grpc_error_handle prepare_socket(SOCKET sock,
|
|
294
294
|
|
295
295
|
failure:
|
296
296
|
CHECK(!error.ok());
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
GRPC_ERROR_CREATE_REFERENCING("Failed to prepare server socket",
|
301
|
-
&error, 1),
|
302
|
-
grpc_core::StatusStrProperty::kTargetAddress,
|
303
|
-
addr_uri.ok() ? *addr_uri : addr_uri.status().ToString()),
|
304
|
-
grpc_core::StatusIntProperty::kFd, (intptr_t)sock);
|
297
|
+
error = grpc_error_set_int(GRPC_ERROR_CREATE_REFERENCING(
|
298
|
+
"Failed to prepare server socket", &error, 1),
|
299
|
+
grpc_core::StatusIntProperty::kFd, (intptr_t)sock);
|
305
300
|
if (sock != INVALID_SOCKET) closesocket(sock);
|
306
301
|
return error;
|
307
302
|
}
|
@@ -391,8 +386,8 @@ static void on_accept(void* arg, grpc_error_handle error) {
|
|
391
386
|
// this is necessary in the read/write case, it's useless for the accept
|
392
387
|
// case. We only need to adjust the pending callback count
|
393
388
|
if (!error.ok()) {
|
394
|
-
|
395
|
-
|
389
|
+
LOG(INFO) << "Skipping on_accept due to error: "
|
390
|
+
<< grpc_core::StatusToString(error);
|
396
391
|
|
397
392
|
gpr_mu_unlock(&sp->server->mu);
|
398
393
|
return;
|
@@ -405,7 +400,7 @@ static void on_accept(void* arg, grpc_error_handle error) {
|
|
405
400
|
if (!wsa_success) {
|
406
401
|
if (!sp->shutting_down) {
|
407
402
|
char* utf8_message = gpr_format_message(WSAGetLastError());
|
408
|
-
|
403
|
+
LOG(ERROR) << "on_accept error: " << utf8_message;
|
409
404
|
gpr_free(utf8_message);
|
410
405
|
}
|
411
406
|
closesocket(sock);
|
@@ -415,7 +410,7 @@ static void on_accept(void* arg, grpc_error_handle error) {
|
|
415
410
|
(char*)&sp->socket->socket, sizeof(sp->socket->socket));
|
416
411
|
if (err) {
|
417
412
|
char* utf8_message = gpr_format_message(WSAGetLastError());
|
418
|
-
|
413
|
+
LOG(ERROR) << "setsockopt error: " << utf8_message;
|
419
414
|
gpr_free(utf8_message);
|
420
415
|
}
|
421
416
|
int peer_name_len = (int)peer_name.len;
|
@@ -427,12 +422,11 @@ static void on_accept(void* arg, grpc_error_handle error) {
|
|
427
422
|
if (addr_uri.ok()) {
|
428
423
|
peer_name_string = addr_uri.value();
|
429
424
|
} else {
|
430
|
-
|
431
|
-
addr_uri.status().ToString().c_str());
|
425
|
+
LOG(ERROR) << "invalid peer name: " << addr_uri.status();
|
432
426
|
}
|
433
427
|
} else {
|
434
428
|
char* utf8_message = gpr_format_message(WSAGetLastError());
|
435
|
-
|
429
|
+
LOG(ERROR) << "getpeername error: " << utf8_message;
|
436
430
|
gpr_free(utf8_message);
|
437
431
|
}
|
438
432
|
std::string fd_name = absl::StrCat("tcp_server:", peer_name_string);
|