Skip to content

Bug: a WGC recording stopped from another server instance is marked stopped but keeps recording #182

Closed

Description

@TMHSDigital

Why it matters

WGC recordings (backend: "wgc", #113) run under a node wgcRecorder.js child, not ffmpeg. Instance B stopping instance A's WGC session through the shared registry, or the orphan reaper, finds a live pid that is not ffmpeg.exe. It skips the kill and still marks the session stopped, so the recording keeps going and the registry is wrong.

Evidence

  • src/tools/startRecording.ts:186 spawns node wgcRecorder.js, so record.pid belongs to node.exe.
  • src/utils/sessions.ts:128: return /"ffmpeg\.exe"/i.test(res.stdout);
  • src/utils/lifecycle.ts:124: the cross-instance stop only kills when isFfmpegProcess(pid) is true, but marks the session stopped either way.

Suggested approach

Store the expected image name (ffmpeg.exe or node.exe) in the session record and check against it. For WGC, prefer a graceful stop the recorder already understands (it stops on q) before falling back to a kill. If the process is still alive after the attempt, return an error rather than stopped.

Done when

  • A cross-instance stop of a WGC session terminates the recorder and finalizes the file.
  • A stop that fails to terminate the process reports failure, not stopped.
  • Tests cover the image-name check for both backends.

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