diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-20 02:21:52 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-20 04:00:32 -0300 |
| commit | 1967cf64dc6d7490d386db874cf1866b764f235c (patch) | |
| tree | fd11484ffcb69b6e70fe6ea9610e8fdfb8d682bf /runtime/session.zig | |
| parent | 969369d4b84fa1847dc3dee0e737dcd58e56c5e7 (diff) | |
| download | pardes-1967cf64dc6d7490d386db874cf1866b764f235c.tar.gz pardes-1967cf64dc6d7490d386db874cf1866b764f235c.zip | |
daemon: a session registers again with a daemon that was restarted: its link's reader, woken by the link's end alone (no timer, no poll: an idle session stays at 0 wakeups), dials the next daemon, starting one if none answers, and says its hello again on the link's own fd (dup3, so the session's own sends never race a new fd); the session loop, woken once by the note, tells it its shells' masters (`Ptys.tellDaemon`) and its clients again (`relinked`); a link the daemon never took (another build's) or the session's own end (`quit`) is not dialled again; test/daemon.py's `relink` (in plain, and alone as `--relink`), first failing on the base ("a daemon again" timed out: nothing dialled), now: the daemon killed, its two sessions (one detached, one with its terminal) start the next and are listed again with their shells, a client attaches, the detached one killed outright leaves its shell to another's Adopt, 0 and 0 wakeups in 2 s before and after; and the killed-session words in daemon.py read once the test's terminal has them (a race of the test's own); gated with the previous change, Debug: tui core-test 855/1005, shell-test 1046/1049, term 17/17, pane 183/184, kitty 45/45, behaviour 275/275 and its replay, process-test 0 of 144 failed, both soaks diverged 0 unequal 0 at 30/80/207 ms (corpus 22 scenes the same), daemon.py plain (50 cycles), far, games, window-clients, gui, upgrade both ways with clients attached pass; gui unit-test 1643/1647 (BaselineHarnessMismatch only); macOS x86_64 and aarch64, FreeBSD cross-builds pass; the frame and perf gate against tree2 PASS: 77/77 frames, perfab-corpus2x -0.114% (threshold 0.4%), 121 per-operation counts within 0.1% (largest +0.014%)
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'runtime/session.zig')
| -rw-r--r-- | runtime/session.zig | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/session.zig b/runtime/session.zig index 55b42b60..4172ba8d 100644 --- a/runtime/session.zig +++ b/runtime/session.zig @@ -24,7 +24,7 @@ //! - `sent()`: after each step's unit went to the clients. //! - `upgradeAsked()`: an Upgrade asked in the step, done (it execs). //! - `note(n)`: what the daemon says (an adopted shell, a client's -//! connection), onto its queue. +//! connection, a new daemon's hello taken), onto its queue. //! - `watched()`: the files it watches (a Restore stops watching them). //! - `restoring(nc)`, `restored(l)`: a Restore's new core, before it //! replaces the old one (its devices let go, what it is told of the @@ -139,8 +139,10 @@ pub fn Loop(comptime Frontend: type) type { } /// What the daemon says, onto the frontend's queue (once: its - /// reader is started by the first call). + /// reader is started by the first call); and a daemon started + /// since the last one died told the shells' masters it held. pub fn watch(l: *L) void { + if (daemon.relinked()) l.ptys.tellDaemon(); daemon.watch(l.fe, note); } |
