Skip to content

fix: ffmpeg process leaked on export errors and encoder fallback retries #31

@sabbour

Description

@sabbour

Description

When an exception occurs during video export after the ffmpeg subprocess is created, the process is never terminated or closed. The finally block only cleans up _merged_audio_path but not proc. Additionally, during encoder fallback retries, a new ffmpeg process is launched without killing the previous one — each retry orphans a zombie process.

Acceptance Criteria

  • proc.kill() + proc.wait() added to the finally block in _run() (around line 1139-1147)
  • Previous proc is explicitly killed before launching a new one during encoder fallback (around line 1106-1112)
  • proc.stdin/proc.stderr are closed on all error paths
  • No orphaned ffmpeg processes after a failed or cancelled export

Affected Areas

  • followcursor/app/video_exporter.py (lines 1052-1147, 1082-1112)

Notes

The pipe writer thread (line 823-833) only catches BrokenPipeError | OSError. Other exceptions (e.g. ValueError on a closed pipe) will crash the writer silently, leaving the producer blocked forever. Consider catching Exception in the writer or adding explicit error signaling.

Metadata

Metadata

Labels

area/exportVideo/GIF export pipelinetype:bugSomething broken

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions