Skip to content

socket: interrupted (EINTR) plain TCP reads/writes and TLS reads are reported as errors #1799

Description

@FlorentinDUBOIS

#1795 made flush_tls (lib/src/socket.rs) retry a write the kernel interrupted (EINTR, ErrorKind::Interrupted). The other socket paths in lib/src/socket.rs still map it to SocketResult::Error:

  • tcp_socket_write (plain TCP socket_write of TcpStream and SessionTcpStream): every error other than WouldBlock, ConnectionReset, ConnectionAborted, BrokenPipe and ConnectionRefused falls into the generic arm;
  • tcp_socket_write_vectored (plain socket_write_vectored): same mapping;
  • plain_socket_read (plain socket_read): same mapping;
  • rustls_socket_read (FrontRustls::socket_read): rustls's read_tls propagates the transport's Interrupted (only complete_io retries it), and the pass reports it as RustlsReadFault::ReadTls / Error.

EINTR says nothing about the socket, so it must neither end the call as an error nor as WouldBlock. A caller that closes on Error closes a healthy session: the pipe path already does on a front write (lib/src/protocol/pipe.rs, "front socket write error"), and #1793 makes the H1 and h2c mux paths close a session whose client write failed.

Expected: retry the syscall on Interrupted, as flush_tls, the relay (lib/src/protocol/proxy_protocol/relay.rs), the UDP path (lib/src/udp.rs), the lingering-close read (lib/src/protocol/mux/shared.rs) and std's write_all do.

Related, not covered here: the TLS handshake pump (handshake_read and the write_tls arm of the handshake loop in lib/src/protocol/rustls.rs) has the same mapping.

Activity

  1. added 2 commits that reference this issue on Oct 2, 2026
    11f12b7
    3aec703
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions