From 63f59cbf3092c8bb7e3eae155969c0249fe2063d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sat, 21 Nov 2026 01:34:10 -0300 Subject: replica: an attach handed to a session as it upgrades is told so and joins the new process, never cut unanswered by the exec: `Peers.refuseAll` returned at once when no client was joined, and with clients its `drop` closed the connections queued in `Peers.inbox` without a word, and a hand-over posted after it was closed by the exec (MSG_CMSG_CLOEXEC), so `pardes attach NAME` started as NAME upgraded said "the session hung up before the dump was whole" and exited 1, with PARDES_PAIR or without (exp2: a `new --detach` session, no variable, ReleaseSafe main: 2 of 20 attaches at 0 ms); now refuseAll tells each queued connection what it tells its clients (`replica.upgrading`, "the session is upgrading to another build of pardes", the words tui and gui passed), `Peers.upgrading` makes `post` tell a later hand-over the same at once (reset at the next boundary: the exec failed), and a first join told so dials again patiently (`join` -> `redial`, its view optional); the pair row that failed on the release build only (daemon.py --pair, `ended_by(how, *attached('rows'))`, the coordinator's landing check) was this race, reached through the test: its `upgraded()` waited for `--upgraded=` in the session's command line, which a second Upgrade's old process already had, so it attached to the old process; found under strace (the daemon handed the attach, then took the session's `upgrade`, then exec'd); the release build and the test's long runtime path only moved the timing; `upgraded()` now waits for the session's 9P socket made anew; tests: core/replica.zig "an Upgrade tells a client handed to the session and not joined yet that it is upgrading ..." (main: both hand-overs still queued, never told), test/daemon.py `attach_upgrading` (plain, --pair, --attach-upgrading: an attach started 0-25 ms after the Upgrade's word, without the variable and with it: main's release build failed its first round) Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- dev/gui/gui.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dev/gui/gui.zig') diff --git a/dev/gui/gui.zig b/dev/gui/gui.zig index 521f685f..d10173b4 100644 --- a/dev/gui/gui.zig +++ b/dev/gui/gui.zig @@ -2501,7 +2501,7 @@ const Shell = struct { core.settle(); // Its replica clients told, their views gone before the dump: each // dials the session again once it is back. - s.peers.refuseAll(core, "the session is upgrading to another build of pardes"); + s.peers.refuseAll(core); var rec: upgrade.Record = .{ .link = daemon.link, .window = s.gui != null, .exe = path }; s.ptys.record(&rec); var at_buf: [1024:0]u8 = undefined; -- cgit v1.3