diff options
| author | user <user@clank> | 2026-08-13 00:04:44 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-13 00:04:44 +0200 |
| commit | cae222e144fefcbe6a6eaa2a3007e8b2b4c9ed95 (patch) | |
| tree | daadb663a14c648311c6d11b69d3dd57467126df /sl0ppij/zellij-server/src/os_input_output_unix.rs | |
| parent | release: 0.1.1, and stop the CLI carrying a second version (diff) | |
| download | sl0ppi-cae222e144fefcbe6a6eaa2a3007e8b2b4c9ed95.tar.gz sl0ppi-cae222e144fefcbe6a6eaa2a3007e8b2b4c9ed95.tar.xz sl0ppi-cae222e144fefcbe6a6eaa2a3007e8b2b4c9ed95.zip | |
sl0p: stop suspended panes spamming resize errors
Attaching to a session of `start_suspended` panes could drop the client with
"your zellij client lost connection to the zellij server", and `zellij action`
against that live session failed most of the time.
Cause: `set_terminal_size` treats "no fd for this terminal id" as an error, but a
reserved-and-not-yet-started terminal is exactly what `start_suspended` (and any
held pane) is. Resizes arrive in cached bursts (ResizeCache), so every attach and
every layout change logged one formatted, contexted, file-written error PER
suspended pane, on the server's hot path.
The map distinguishes the two cases already -- `Some(None)` is reserved-without-fd
(reserve_terminal_id), `None` is genuinely unknown -- so the fix is to match them
separately and stay quiet about the former.
Measured on a 2-vCPU Debian box, `action list-tabs` against a live session:
before 2 suspended panes 5/12 failed 2 plain panes 1/12 failed
after 2 suspended panes 6/30 failed 2 plain panes 9/30 failed
resize errors logged: 126+ -> 0
ie. the suspended-pane penalty is gone; what remains is a separate baseline
failure rate that affects plain sessions equally (see the known issue in
docs/roadmap.md).
zellij-server: 1499 tests still pass.
Diffstat (limited to 'sl0ppij/zellij-server/src/os_input_output_unix.rs')
| -rw-r--r-- | sl0ppij/zellij-server/src/os_input_output_unix.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sl0ppij/zellij-server/src/os_input_output_unix.rs b/sl0ppij/zellij-server/src/os_input_output_unix.rs index 599bb2a..c6e1dec 100644 --- a/sl0ppij/zellij-server/src/os_input_output_unix.rs +++ b/sl0ppij/zellij-server/src/os_input_output_unix.rs @@ -381,7 +381,21 @@ impl UnixPtyBackend { set_terminal_size_using_fd(*fd, cols, rows, width_in_pixels, height_in_pixels); } }, - _ => { + // sl0p fork: a KNOWN terminal id with no fd yet is a pane whose + // command has not started -- `start_suspended`, or a held pane + // waiting for a keypress. There is nothing to resize and nothing is + // wrong, so do not treat it as an error. + // + // It used to fall into the arm below and log one error per + // suspended pane per resize. Resizes arrive in cached bursts (see + // ResizeCache), so attaching to a session of suspended panes + // produced a storm of formatted, contexted, file-written errors on + // the server's hot path. Measured on a 2-vCPU box: `zellij action` + // against a live session failed 5/12 with two suspended panes + // versus 1/12 with two ordinary ones, and attached clients dropped + // with "lost connection to the zellij server". + Some(None) => {}, + None => { Err::<(), _>(anyhow!("failed to find terminal fd for id {terminal_id}")) .with_context(err_context) .non_fatal(); |
