summaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-21 01:34:10 -0300
committerGabriel Schneider <[email protected]>2026-11-21 01:51:21 -0300
commit63f59cbf3092c8bb7e3eae155969c0249fe2063d (patch)
tree09b8e3631b3e7797e597124dedb284f09f2d8cd7 /dev
parent6d937cd125ca04a2edb92b2d014014ee6c2eb45d (diff)
downloadpardes-63f59cbf3092c8bb7e3eae155969c0249fe2063d.tar.gz
pardes-63f59cbf3092c8bb7e3eae155969c0249fe2063d.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'dev')
-rw-r--r--dev/gui/gui.zig2
-rw-r--r--dev/tui/tui.zig2
2 files changed, 2 insertions, 2 deletions
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;
diff --git a/dev/tui/tui.zig b/dev/tui/tui.zig
index e441df92..a6d2216d 100644
--- a/dev/tui/tui.zig
+++ b/dev/tui/tui.zig
@@ -1306,7 +1306,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, .stub = daemon.stub, .exe = path };
s.ptys.record(&rec);
if (s.screen) |sc| if (sc.on) rec.addTty(.{