Skip to content

Name the cause of recorder helper exits and report an unexplained exit only once - #218

Merged
Views2k merged 2 commits into
mainfrom
fix/recorder-exit-cause
Nov 18, 2026
Merged

Views2k merged 2 commits into
mainfrom
fix/recorder-exit-cause

Conversation

@Views2k

@Views2k Views2k commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Closes #216

Tools has shown "Recorder process exited" (reason helper_exited) with only an exit code since October, four PCs in the last four days. Tracing Wisp.Recorder.exe: exit code 3 is the helper's own failure exit after it writes a recorder_failure line (stage host_configuration, host_loop or host_exception), and a recoverable transition also ends with 3 when its cleanup fails. Exit code 35 is the watchdog's progress timeout (ProgressTimeoutExit), which wrote nothing. Of the 12 exits in 30 days, 8 already had the helper's own diagnostic beside them, so the board row duplicated a cause that was already reported, and the other 4 had no cause at all.

What changed

Helper (tools/Wisp.RecorderPrototype):

  • Every watchdog exit (codes 31 to 35) first writes a diagnostic line with reason helper_timeout, the media thread's last stage and the exit code as a FACILITY_ITF hr. The media thread's stage is published through a shared atomic (StageMarker) so the watchdog thread can read it; the spool-writer deadline uses the same path.
  • A cleanup that fails writes one cleanup_failed line naming the step (audio_cleanup, capture_cleanup, video_cleanup, spool_cleanup, runtime_cleanup) with its HRESULT, from a separate budget slot so the terminal failure's line is kept.
  • Reason::HelperTimeout is added to the protocol (diagnostic line only). RECORDER-PROTOCOL.md documents the exit codes.

Client (RecorderProcessClient):

  • helper_exited is reported as an incident only when the helper left no terminal diagnostic. The decision waits for the stderr drain (2 s cap), since the helper's line can arrive after stdout's EOF. The client failure, the error state event and the service's recovery path (backoff, three attempts, then "Enable clipping to try again") are unchanged.
  • helper_timeout is accepted from the diagnostic line; the four cleanup stage tokens are in the diagnostic and incident allowlists.

Transparent restart already exists in ClipRecorderService.RequestRecovery, so no change there.

Verified

  • Wisp.App and Wisp.App.Tests compile locally. New tests: an exit after the helper's diagnostic produces one incident (the diagnostic's), an exit without one produces helper_exited with its exit code; the stage-coverage test now also checks the cleanup stage tokens.
  • The helper is compiled by CI's BuildWispRecorder target; it cannot be compiled here.
  • Steam and Store: the helper and client code paths are platform-independent; the affected exits were 3 Steam PCs and 1 Store PC.

Unverified

  • In-game: a watchdog exit and a cleanup failure on a real PC, which is what produces the new lines. The next helper exit in Tools will carry its stage or step.

…t only once

The helper's watchdog exits (codes 31 to 35) now write a diagnostic line first with the media thread's last stage and the exit code, and a failed cleanup writes a cleanup_failed line naming the step. The client reports helper_exited only when the helper left no diagnostic; an exit that follows the helper's own failure line is already reported through that line. The protocol document lists the exit codes.

Closes #216
@Views2k
Views2k marked this pull request as ready for review November 18, 2026 03:18
@Views2k
Views2k merged commit 40b7d37 into main Nov 18, 2026
10 checks passed
@Views2k
Views2k deleted the fix/recorder-exit-cause branch November 18, 2026 03:36
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.

Recorder helper exits with code 3 or 35 while buffering; incidents carry no cause

1 participant