frigate/frigate/record
Ivan Shvedunov 909b40ba96
Some checks are pending
CI / AMD64 Build (push) Waiting to run
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / ARM Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions
Fix export deadlock by replacing preexec_fn with nice command (#22641)
subprocess.run() with preexec_fn forces Python to use fork() instead
of posix_spawn(). In Frigate's main process (75+ threads), fork()
creates a child that inherits locked mutexes from other threads. The
child may deadlocks e.g. on a pysqlite3 mutex before it can exec()
ffmpeg.

Replace preexec_fn=lower_priority (which calls os.nice(19)) with
prefixing the ffmpeg command with "nice -n 19", achieving the same
priority reduction without requiring preexec_fn. This allows Python
to use posix_spawn() which is safe in multithreaded processes.

Fixes both the primary export path and the CPU fallback retry path.
2026-03-26 05:34:28 -06:00
..
__init__.py Ability to manually create events through the API (#3184) 2023-05-19 05:16:11 -05:00
cleanup.py Inverse mypy and more mypy fixes (#22645) 2026-03-25 19:30:59 -05:00
export.py Fix export deadlock by replacing preexec_fn with nice command (#22641) 2026-03-26 05:34:28 -06:00
maintainer.py Inverse mypy and more mypy fixes (#22645) 2026-03-25 19:30:59 -05:00
record.py Require setting process priority for FrigateProcess (#19207) 2025-08-16 10:20:33 -05:00