Repository navigation
python-codecs: reap frame forks whose event loop or handoff hangs - #2211
Merged
Merged
Conversation
The frame watchdog was an event loop timer, so a fork whose loop wedged never exited, and a fork that hung before generateVideoFrames* ran had no watchdog at all. Assisted-by: Claude Opus 5.5 Signed-off-by: Sergey Vilgelm <sergey@vilgelm.com>
SVilgelm
force-pushed
the
python-codecs/fork-leak
branch
from
November 9, 2026 07:34
959e19c to
bbe9f0f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Idle frame forks pile up in python-codecs (at about 65 MB each) and stay until the daily restart. There are two ways a fork outlives its session. Its watchdog is a loop.call_later timer, so if the fork's event loop wedges (#2210 is one way that happens) the timer never fires. And if the parent hangs awaiting fork.result or the generateVideoFrames* call, the fork's watchdog is never armed, and nothing terminates it because terminate_zygote only runs on an exception. The watchdog now runs on its own thread off a last-activity timestamp, with the same 10 second limit and the same arming points, and the parent bounds both handoff awaits with a 30 second timeout so a hang terminates the fork like any other failure.