Repository navigation
feat(mkv-audit): stop cleanly on Ctrl+C and pass a context to every child process and TMDB request - #306
Merged
Conversation
…hild process and TMDB request The first Ctrl+C stops before the next file or at a prompt without taking its default; the second kills mkvmerge and mkvextract, never mkvpropedit. Interrupted files are not recorded as failures, and the run exits 130. Part of #294
…p re-waiting on EOF, and pin the interrupt paths An interrupted run now takes the failures it got through, and those that are gone, off the retry list. Once stdin has ended, prompts return at once instead of each waiting for an interrupt. A file the interrupt skips prints a [STOP] line, and an ID whose lookup finished is still saved. Tests now cover the post-prompt checks, auto-all loops, mux and mkvextract kills, and fail rather than hang.
… failure once, and say nothing about a TMDB match an interrupt cut short
… finished, and pin new and repeated failures in the list
…tops its MKV's trim
This was referenced Dec 5, 2026
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.
Part of #294
Problem
Ctrl+C killed mkv-audit wherever it was, including mid-conversion or mid-trim, and it could accept a prompt's default on the way out. It also passed no
context.Contextto its children or TMDB requests, whichnoctxneeds. This ports the cbz-fix design (#304) to mkv-audit.Change
mkv-audit/interrupt.go,command*.goand their tests: copied from cbz-fix, with names, notices and test helper env vars adapted.mkv-audit/runner.go:mkvpropeditruns oncontext.Background(), so it is never killed.mkvmergeandmkvextractrun oncommand(ctx, …).[STOP]and isn't counted as failed.prompt.go: the read runs in a goroutine and the prompt returns on Ctrl+C. EOF waits 250 ms for an interrupt, then latches, as the old Scanner did.convert.go,remux.go,mka_date.go: a killedmkvmergeremoves its temp file and leaves the source alone. It counts as the interrupt even though on Windows it exits 1, the code for warnings.tmdb.go: requests usehttp.NewRequestWithContext; errors still pass throughredactAPIKey.main.go: the summary is headedINTERRUPTEDand the exit code is 130.README.md: the Ctrl+C behaviour.Behavior
Before: Ctrl+C killed mkv-audit and its
mkvmergeat once, and could leave a temp file behind.After:
mkvmerge/mkvextract. The file is left as it was.Left for #294: the other four modules, re-raising the signal instead of exiting 130, and enabling
noctx. Out of scope and already on main: with stdin closed, the und prompt applies the default IETF tag.Verification
nohup.golangci-lint run --enable-only noctxreports 0 issues for mkv-audit.AI assistance
Written with Claude Code (Claude Opus 5.5). It self-reviewed the diff over five rounds and ran the checks above.