Files
scrypted/plugins
reinierlakhan d728c4ab7d python-codecs: arm zygote fork self-destruct at call time, not first frame (#2139)
CodecFork.generateVideoFramesLibav and generateVideoFramesGstreamer are async
generator functions, so their bodies -- including the call_later(10, timeoutExit)
that lets the worker kill itself -- do not run until the caller requests the first
frame. The PluginFork handle is discarded at handout in LibavGenerator and
GstreamerGenerator, so a worker that is handed a session but never iterated has no
watchdog and no reachable terminate(), and idles for the life of the plugin host.

aclose() on a never-started async generator returns without executing the body, so
even a consumer that closes the RPC proxy cannot trigger the self-destruct.

Make the two methods coroutines that return the inner generator. rpc.py does
await maybe_await(invoke(*args)) before serializing, so the async iterator proxy
seen by the caller is unchanged, but the watchdog is armed as soon as the fork is
committed to a session.

Also keep the PluginFork handle at the call sites and terminate it if the session
cannot be handed to the caller.

Fixes #2138


Claude-Session: https://claude.ai/code/session_018kjDzffi8VZKA1mn6nrGfo

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-06 22:54:35 -07:00
..
2026-01-08 08:31:57 -08:00
2024-03-25 12:44:25 -07:00
2026-03-08 10:39:00 -07:00
2025-07-31 11:03:24 -07:00
2024-02-12 15:52:11 -08:00
2024-08-10 10:36:26 -07:00
2025-10-03 08:03:47 -07:00
2026-03-08 10:42:04 -07:00
2026-03-08 10:39:00 -07:00
2024-11-08 09:14:11 -08:00
2025-06-18 14:01:16 -07:00
2023-06-30 17:58:23 -07:00
2025-07-22 11:11:16 -07:00
2024-11-15 10:02:13 -08:00