Survive the Ultimate going away: quick exit, stream-lost screen - #23
Merged
Merged
Conversation
Powering the Ultimate off with the viewer running looked like a freeze followed by a crash. It was neither: the stream view kept the last frame with no hint, and Ctrl+Q then joined the keepalive thread through up to 13 s of REST timeouts without pumping events, long enough for Hyprland's "Application Not Responding" dialog before the process finished on its own (no coredump; the D-Bus screensaver un-inhibit shows a normal exit). - Keepalive REST calls take a cancel flag (curl xferinfo callback on g_quit) plus a 1.5 s connect timeout, since the callback does not run while a SYN goes unanswered. The stop calls at exit are skipped when the last start got no answer and bounded to 1 s otherwise. - The exit path keeps pumping SDL events until the discovery and keepalive threads report done, then joins them. - After 2 s without a frame the status screen says "no stream from <host>" instead of leaving the last picture standing; the stream view returns by itself with the next frame. - Sockets are opened SOCK_CLOEXEC so the ping spawned for the ARP prime no longer inherits the viewer's connections. - Integration test: a tarpit server (accepts, never answers) stands in for a dead machine; SIGTERM must end the viewer within 3 s (the old binary took 7 s). Reproduction recipe for a vanishing host (user+net namespaces, veth, ip addr del) documented in CLAUDE.md. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GCACXGV72EjRZUUKapybmQ
Found on hardware after the power-off fix: F9 with the Ultimate off entered the menu view anyway, which rendered the terminal's empty black grid (a "black square"), and a machine switched off while the menu view was open kept its last screen up as if it were live, since a silent power-off never closes the telnet link. - F9 enters the menu view only on a live connection; otherwise a 3 s notice on the status screen says the menu is unreachable (powered off? telnet enabled?) and the previous view comes back. - A menu connection that closes or fails to send drops the view with a "connection lost, F9 reconnects" notice. - Stream loss closes the menu link and leaves the view: the "no stream" screen replaces the stale menu; F9 reconnects once the machine is back. - Notices restore the stream-lost or waiting text when they expire. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GCACXGV72EjRZUUKapybmQ
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GCACXGV72EjRZUUKapybmQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Switching the Ultimate off with the viewer running looked like a freeze followed by a crash. Root cause: the stream view kept the last frame with no hint, and Ctrl+Q then joined the keepalive thread through up to 13 s of REST timeouts without pumping events, which is longer than Hyprland's "Application Not Responding" threshold (about 8 s). The process then exited on its own. There was no crash: no coredump, and the journal shows the normal D-Bus screensaver un-inhibit right before the scope ended.
Changes
g_quit) and get a 1.5 s connect timeout, because the callback does not run while a SYN goes unanswered. The stop calls at exit are skipped when the last start got no answer, and bounded to 1 s otherwise.SOCK_CLOEXEC, so thepingspawned for the ARP prime stops inheriting the viewer's connections.ip addr delon the far end, Hyprlandsend_shortcutfor keys).Verified
make testandtests/integration.shpass.🤖 Generated with Claude Code
https://claude.ai/code/session_01GCACXGV72EjRZUUKapybmQ