fix(cast): end a recording with the exited session's last screen #19

Merged
natsukium merged 1 commit from fix/record-final-screen into main 2026-10-15 01:31:56 +09:00
Owner

Fixes the flaky program-exit recording: output lost between pulls at PTY EOF, and an exit before the subscription never seen. record re-attaches to the exited session and writes its last screen.

Fixes the flaky program-exit recording: output lost between pulls at PTY EOF, and an exit before the subscription never seen. record re-attaches to the exited session and writes its last screen.
fix(cast): end a recording with the exited session's last screen
All checks were successful
ci / cargo fmt / clippy / test / deny (pull_request) Successful in 53s
ci / cargo fuzz smoke (pull_request) Successful in 1m59s
ci / cargo fmt / clippy / test / deny (push) Successful in 49s
ci / cargo fuzz smoke (push) Successful in 1m58s
20d94b957f
A program that prints and exits at once was sometimes recorded without
its output, or not seen to exit at all (the recording ran to
--max-duration). Both showed up as a flaky integration test under load,
roughly one run in ten of the release test binary.

The causes are in how felis ends a session. The daemon sends a
pull-paced subscriber its next cycle only in answer to a pull, and at
PTY EOF it pushes SessionExited and drops its subscribers, so output
that landed between two of the recorder's pulls is never sent. And a
program that exits before the recorder's subscription lands sends that
subscription no SessionExited at all; the attach reports the exit in
SessionInfo.exited instead.

record now treats an attach that reports an exited session as the
program exiting, and on the exit attaches again (not live_only, so it
lands on the screen the session keeps through its post-exit grace) and
writes the size and burst that attach opens with as the last units. The
extra attach is bounded by the follow-up timeout and is skipped silently
when it fails, leaving the recording as before. Asking felis to flush a
final cycle at EOF would fix it at the source but needs a felis release;
this works against the daemon as it is.
natsukium deleted branch fix/record-final-screen 2026-10-15 01:31:56 +09:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
natsukium/felis-fcast!19
No description provided.