Skip to content

Bug: WGC recorder leaves ffmpeg and the redraw PowerShell running on its failure paths #208

Closed

Description

@TMHSDigital

Why it matters

Each failed backend: "wgc" start can leave a powershell.exe that repaints the target window every 200 ms until that window closes. An agent that retries a failing WGC capture piles these up.

Evidence

  • src/wgcRecorder.ts:122-127: when the grab ffmpeg exits before the encoder starts, it calls process.exit(1) without nudge.kill().
  • src/wgcRecorder.ts:85: when the encoder crashes, it exits without killing grab or nudge.
  • The nudge script loops while(IsWindow(h)){ RedrawWindow…; Sleep 200 } (src/utils/wgc.ts:105), so it outlives the recorder.

Suggested approach

Add one cleanup() that kills every child (grab, encoder, nudge) and is called before every process.exit and on signals. Optionally pass the recorder's PID to the nudge script so it also exits when the parent is gone.

Done when

  • A test (or a manual check on the Windows CI leg) shows that a forced early grab failure leaves no powershell.exe or ffmpeg.exe children.

Activity

  1. added
    bug
    effort: small
    impact: medium
    on Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugeffort: smallimpact: mediumpriority: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions