Skip to content

fix(cli): handle SIGTERM during native playback - #61

Closed
fperex wants to merge 1 commit into
mainfrom
fix/play-sigterm
Closed

fperex wants to merge 1 commit into
mainfrom
fix/play-sigterm

Conversation

@fperex

@fperex fperex commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Problem

The native player (moq ... play) waited only on Ctrl-C, so a supervisor's SIGTERM killed it on the default action. run_play also never closed the client, so even a clean exit sent no QUIC close and the relay noticed only after its idle timeout.

Fix

The window waits on the shared shutdown_signal() (SIGINT, and SIGTERM on Unix). run_play keeps the attached connection and the client and closes both after playback, including when setup fails, as run_stages already does. doc/bin/cli.md states the signal behavior.

Test

play::window::tests::sigterm_finishes_playback sends a real SIGTERM and requires the window's shutdown event; it is killed by the signal on main and passes with the fix. Two shutdown_signal tests cover SIGINT and SIGTERM. These rely on nextest's per-test processes. Manual run against a local relay: after SIGTERM the relay logged a clean close 5 ms later; on main it logged an idle timeout about 10 s later. just check passes with and without --features play.

API and wire

None.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

The player waited only on Ctrl-C, so a supervisor's SIGTERM killed it on the
default action and the relay waited out its idle timeout to notice. Use the
shared shutdown signal in the window, and close the client after playback so
the QUIC close goes out, as `run_stages` does.

Exercise both signals with real signals in isolated nextest processes: one
against `shutdown_signal`, one against the window's shutdown event.

Refs #51.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@fperex

fperex commented Oct 7, 2026

Copy link
Copy Markdown
Owner Author

Closing: this fix is included in #3 on top of current main. (Written by Claude Opus 5.5)

@fperex fperex closed this Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant