Repository navigation
fix(keyframes): expire cached probe failures so they can recover - #8
Merged
Merged
Conversation
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.
Summary
probe_keyframescached a failed probe for the life of the process. One transient ffprobe failure on unchanged media meant the re-encode fallback for good. A failed probe is now remembered forFAILED_PROBE_RETRY_SECand then retried.Noneon failure, the safe fallback.extract.pyandcli.pyare untouched.Plan unit: KC-2 (portfolio remediation 2026-09-29).
Design decisions to review
Noneresult gets the window: non-zero exit, missing ffprobe, timeout, and a clean exit with no keyframes. Transient and permanent failures are not told apart.Test plan
TestFailedProbeRecoveryintests/test_keyframes.py, with a mocked clock: fail then succeed recovers after the window and the recovered result is cached; repeated failures inside the window run ffprobe once; a persistent failure re-probes at most once per window; a changed file is re-probed inside the window. All four were red before the change.ruff check .clean.Acceptance
test_failure_then_success_recovers_after_the_retry_window.test_repeated_failures_inside_the_window_do_not_reprobe,test_persistent_failure_reprobes_at_most_once_per_window.test_changed_file_is_reprobed_inside_the_failure_window.Not in this PR