From 744f1029ee2a02a43cb0fc70e32f70b60b100b75 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sat, 21 Nov 2026 05:49:21 -0300 Subject: client: a link an Upgrade's exec cuts with no last word joins again: `Peers.refuseAll` queues each client's `refused` after what it is still being sent and gives the writers 200 ms (`flushed200`), then `drop` cuts every link, so a client whose join's dump was still on its way read the cut as its session's end and exited 1 ("'NAME' let this client go"), with PARDES_PAIR or without (a `new --detach` session holding a 100 MB file, the Upgrade written as the attach is listed: 3 of 3 on main's ReleaseSafe build, 3 of 3 Debug); now a near link that ends with no last word asks this machine's daemon whether its session is listed still (`replica.cutListed`), and listed, joins again as one told `upgrading` (runtime/client.zig `Loop.run`; a first join cut mid-dump likewise, `replica.join`), so no flush bound decides a client's fate; a patient redial stops at once at "no session called" (`redial`: a session killed outright costs no 20 s of dialling); a far client and a no-daemon pair ask nobody (nothing changes); test/daemon.py `attach_upgrading` gains the round (two attaches to a 100 MB session, the Upgrade written as each joins; plain mode and --attach-upgrading): failed on merge48's builds, passes on both builds; tui core-test 885/1045 (160 skipped) Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- runtime/client.zig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime') diff --git a/runtime/client.zig b/runtime/client.zig index d4b76a1b..789cac27 100644 --- a/runtime/client.zig +++ b/runtime/client.zig @@ -218,6 +218,10 @@ pub fn Loop(comptime Frontend: type) type { reader.join(); _ = libc.close(s.joined.fd); s.joined.rest.deinit(s.gpa); + // Its link cut with no word by a session that is there still + // (an Upgrade's exec): joined again, as when told so. + if (link.gone and link.refused == null and link.ended == null and !link.left and s.have == null and replica.cutListed("the session hung up", s.dial.session)) + link.refused = std.heap.c_allocator.dupe(u8, replica.upgrading) catch null; // Why it joins again is in its notice until a key. if (!link.rejoins()) { // What it made since it joined, kept for its next start. -- cgit v1.3