diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-20 04:17:12 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-20 05:21:29 -0300 |
| commit | 8d9f4c88072089b53c77ab7e66b01c461fbbee74 (patch) | |
| tree | 590a18e451e7bc9a60eae087217b51f0ceb74efa /runtime | |
| parent | 6e8735895d04c0073eb28cc1a2f431a2ba587e9d (diff) | |
| download | pardes-8d9f4c88072089b53c77ab7e66b01c461fbbee74.tar.gz pardes-8d9f4c88072089b53c77ab7e66b01c461fbbee74.zip | |
dev, runtime: the addons' jobs and draws, the pipes and a search answer through the session's one queue in both frontends, and their workers are the queue's: the terminal's own posts to vaxis's queue are deleted (its pipe_done, search_rows and kind_job messages and their arms in apply and in Own.close's drain, deliverSearch, deliverPipe, the two inline deliver functions), its pipe, search, job and draw post with Inbox.pushPipe, pushSearch and pushJob as the window's did and takeQueue lands them; Inbox.land (landLsp grown to every worker's answer: a pipe's, a search's rows, a job's or a draw's, a handover's end) replaces the two frontends' copies of those arms; pipe_tasks and job_tasks leave both Shells and the window's Own for the Inbox beside lsp_task, ended in Inbox.deinit (and so a client's draws in both clients, which the terminal's client never canceled), the pipes canceled by the session loop's Restore and the search's worker by the loop's end, not by each frontend's close and restoring; a terminal client's queue wakes its loop (wakeForQueue) now that its draws come through it; the test first: on the base a search worker's post into vaxis's full queue waited for the loop to take one and a cancel did end it (vaxis's Queue.push waits on a cancelable condition), so no worker could have hung, but the terminal's keys waited behind up to 512 queued batches of rows in that one queue (the input thread's post waits in it too); now rows wait in the session's queue and keys never behind them, pinned by host_io's test of pushSearch into a full queue (a take lets it in, a cancel ends the wait and frees the rows); tui core-test 857/1008 (151 skipped), shell-test 1048/1051, term 17/17, pane 183/184, kitty 45/45, behaviour-test and --replay 275/275, process-test 0 of 144 failed (wheeldrift and exec failed once in the run, passed on their retries), soak --clients 5 diverged 0, unequal 0, checked/wrong 1874/0 1937/0 1831/0, quiet checks 597/0 673/0 779/0, unlisted 0, corpus 22 of 22, no leak; --bytes --clients 5 diverged 0, unequal 0, quiet checks 693/0 586/0 802/0, corpus 22 of 22, no leak, one unlisted stop at `now` at 30 ms (the base's, known); gui unit-test 1645/1649 with only the perf check's BaselineHarnessMismatch; daemon.py plain, --far, --games, --window-clients, --upgrade both ways pass (upgrade-back failed once at its Adopt into the old build's fresh session, then passed 3 of 3) (load 11-22)
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/session.zig | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/runtime/session.zig b/runtime/session.zig index fdd72c2b..e425fa3f 100644 --- a/runtime/session.zig +++ b/runtime/session.zig @@ -6,10 +6,10 @@ //! posts, `Inbox`), its ptys (`Ptys`) and the files it watches //! (`file_watch.Watches`): a step, its unit to the clients and theirs //! taken in, an Upgrade or a Restore between steps; and the order its -//! parts end in. Its other devices (the LSP's and the pipes' and addons' -//! jobs, the session's own input) are still its frontend's (each `Shell`); -//! the language servers' answers come through its queue (`Inbox.startLsp`). -//! What a frontend does is: +//! parts end in. Its workers (a language server's query, the pipes, the +//! addons' jobs and draws, a search) answer through its queue, which holds +//! their tasks and ends them (`Inbox.land`, `Inbox.deinit`); the session's +//! own input is its frontend's (each `Shell`). What a frontend does is: //! //! - `options(o)`: before the core: what it gives the core it starts (a //! window's size, for a dump's layout). @@ -90,6 +90,8 @@ pub fn Loop(comptime Frontend: type) type { l.peers = .{ .gpa = l.gpa, .io = l.io, .name = daemon.name() }; l.inbox = .{ .io = l.io, .gpa = l.gpa, .lsp_allocator = l.allocs.lsp }; defer l.inbox.deinit(); + // A search's worker may be waiting on the queue for room. + defer l.core.stream.cancelTask(); // The language servers' status lines, from the first effects on. pardes.lsp.setStatusSink(&l.inbox, host_io.Inbox.lspStatus); defer pardes.lsp.setStatusSink(null, null); @@ -162,7 +164,9 @@ pub fn Loop(comptime Frontend: type) type { fn restore(l: *L, path: []const u8) void { const nc = host_io.restoreCore(l.gpa, l.core, path, &l.peers, l.watches.fd, &l.watches.table) orelse return; l.fe.restoring(nc); - // An answer to the old core's query is turned away. + // The old core's pipes end, and an answer to its query is + // turned away. + l.inbox.pipe_tasks.cancelAll(l.io); l.inbox.discardCompletions(); l.ptys.stop(); nc.host = l.host; |
