summaryrefslogtreecommitdiff
path: root/core/Query.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 06:17:22 -0300
committerGabriel Schneider <[email protected]>2026-11-20 10:34:47 -0300
commitd48f044458756cdf807e34842444a7fd1b01498d (patch)
tree594cb51bf2464f4912535f7da0a7af3ee5f00869 /core/Query.zig
parent26d0581168ac4b582025ecb01b36968850344811 (diff)
downloadpardes-d48f044458756cdf807e34842444a7fd1b01498d.tar.gz
pardes-d48f044458756cdf807e34842444a7fd1b01498d.zip
dev: a command's exit is told only once every read its reader took out of the pty is applied: the queue counts each pane's reads read and not yet applied (Inbox.unapplied, raised by the reader the moment a read returns, lowered by Ptys.output once applied, by the reader when its dupe or push fails and by cancelReader for each read it drops), and host_io.takeExits passes over a command whose pty has not ended while its host has such a read (Ptys.unapplied); with it the terminal's guard (takeExits only once the reads taken off the queue were all applied) is deleted, the count holding those too; the test first: Ptys's "a command's exit is told after its output a reader read, however long that waits in the queue" (a reaped command, its pty held open, its last output read and queued) failed on the base, the exit told at once (CommandWatch.due polls the kernel, where the read output no longer is); the run first: process-test's cmdexit alone, 300 times under 16 busy loops, all niced 15 (load 25-33): 3 of 300 drew `exit 0` above BGSTARTED before, 1 of 300 after: what is left is the few instructions between the read's return and the count's raise (a reader preempted on its way back from the syscall), which std.Io gives no way to close (a readiness wait before the read would, and 0.17's Io has none: a raw poll is no cancel point); the exit cannot instead be ordered after the pty's end of file: in the one case that races, what the command left running holds the pty open and the end of file comes only when that ends (cmdexit's `sleep 30`); a user could have hit it: a command that ends leaving a background job on its terminal, its last line drawn below its exit; tui core-test 858/1009 (151 skipped), shell-test 1050/1053, term 17/17, pane 183/184, kitty 45/45; behaviour-test and --replay 275/275 (in the gate, at load 37-50, two addon-test scripts failed and the monkey replay hung a step: both re-run 275/275 and 275/275 at load 25, the two scripts pass alone; addon_test runs no line of this change); process-test whole 1 of 144 failed (pagercolor, on the known list; load 25), in a rerun 2 (pty/run and a control byte through pty/data, both pass alone); 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, its unlisted stop at `now` the base's; gui unit-test 1647/1651 with only BaselineHarnessMismatch; daemon.py plain, --far, --games, --window-clients, --upgrade both ways pass (upgrade failed once at its last Adopt as upgrade-back did in change 1's gate, then 3 of 3) (load 20-50)
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/Query.zig')
0 files changed, 0 insertions, 0 deletions