Repository navigation
et@0.0.36
Bootstrap cleanup spares detached descendants (a9644fa)
After the IDPASSKEY marker, the client's ssh cleanup sent SIGKILL to every local descendant of ssh, including processes that had already left ssh's session with setsid(). When the bootstrap command runs etterminal on the local machine (an ssh wrapper, the test and benchmark harnesses), the scan could catch the freshly registered terminal daemon while its launcher was still exiting, and the client then failed with client is not registered. Cleanup now stops only descendants still in ssh's session, plus anything holding the captured stdout pipe.
Pull request & contributors
One poll loop per process and bounded replay memory (a9644fa)
etterminalon Linux runs onepoll(2)loop over the router socket, the PTY master (or the-Tcommand's stdin/stdout/stderr pipes) and the shell's pidfd, replacing the router pump, blocking PTY reader andwaitpidwaiter threads (and, for-T, the per-pipe readers, the 20 mstry_waitwaiter and the 100 ms pump tick). Idle sessions no longer wake; kernels withoutpidfd_openkeep the threaded runtime.- Batched PTY output frames: consecutive full master reads are shaped (motd newline elision and tmux
-CCfiltering unchanged) and sent as oneTERMINAL_BUFFERof up to 32 KiB instead of one frame per ~4 KiB read;-Toutput frames carry up to 65,472 bytes. Frames are written with resumable vectored writes, so a full router socket never splits one. - Forwarding runs on the session thread: after the session loop first polls forwarding, the forwarding worker hands over its sockets, listeners and timers and exits. Accept, destination request/response, connect, data, credit and close all run in the session's existing poll; per-listener accept threads (and their 100 ms poll / 10 ms retry) are gone on Unix. Forwarded reads pause past a 2 MiB / 256-packet outbound backlog, and the idle window-credit flush moved from 2 ms to 50 ms.
etservercontrol plane on one thread: a singleet-runtimethread accepts on every TCP listener (IPv4 and IPv6) and services terminal lifecycle events and the 1 s resume-expiry sweep, replacing one accept thread per listener plus the lifecycle thread.- Client console output: an idle console is written straight from the session loop when stdout is a non-blocking FIFO or terminal (terminals are now reopened through
/procwithO_NONBLOCK | O_NOCTTY, like FIFOs), skipping the console worker hand-off; short writes and cursor-report requests still go through the worker. SIGWINCH now wakes the session loop directly instead of a dedicated thread, andet -Widles inpoll(2)instead of a 10 ms sleep loop. - Forward listeners skip connections that failed before
accept(ECONNABORTED,EPROTO, unreachable networks) instead of closing the listener, matching upstream's accept loop. - Replay backups trim promptly: after a delivery acknowledgement,
BackedWriterkeeps the unacknowledged tail plus at most 1024 acknowledged packets bounded to 256 KiB (with a 16-packet floor that absorbs foreign acknowledgements relayed by et.rs ≤ 0.0.7 jumphosts), instead of a flat 1024 packets that pinned the whole 8 MiB connected cap for 64 KiB frames. - Acknowledgements by volume: the client sends an acknowledging keep-alive every 512 KiB read or written, also under continuous inbound and on a saturated link; the server's existing echo carries its own acknowledgement, so one keep-alive trims both sides. No server-initiated keep-alives (upstream
TerminalServeronly echoes andTerminalClientnever echoes). - Client delivery gate: once the server has acknowledged at least once, stdin and forwarded sockets pause while 4 MiB is unacknowledged, so loopback socket autotuning can no longer push unacknowledged data past the replay cap. Legacy servers never acknowledge and are never gated; an acknowledgement that stops advancing for one keep-alive interval releases the gate until it advances again, so a stalled echo can never wedge forwarding.
- Server output queue while connected drops from 16 MiB to 2 MiB in total, 1 MiB each for terminal output and for forwarding/control packets (it feeds a 256 KiB
TCP_NOTSENT_LOWATsocket), and the flow writer wakes a backpressured bridge once half of the refusing lane's bytes and packet slots are free instead of after every packet; a bridge refused on the forwarding lane no longer waits for terminal output to drain. - Socket reads size themselves: a connection's first read asks for 16 KiB and grows 4x per full read up to 256 KiB, then halves after short reads and releases the drained bulk buffer. Idle and interactive connections no longer zero-fill a 256 KiB read buffer each: with 16 idle sessions on one server,
etserverdrops from 8.4 to 4.6 MB PSS (ET-C++ 5.9 MB) and the 16 clients from 19.2 to 15.2 MB. - jemalloc: builds bake
narenas:1,dirty_decay_ms:1000viaJEMALLOC_SYS_WITH_MALLOC_CONF(.cargo/config.toml), so freed I/O buffers return to one arena and the kernel within a second; the server keeps muzzy decay at 0. With 8 and 16 saturated sessions on one server, throughput and CPU matchnarenas:4while server RSS stays 5-22% lower. - Idle threads for a session with one
-Land one-Rtunnel: client 6 → 2, server 10 → 5, terminal 3 → 1.