feat: add MakeMKV I/O watchdog to prevent runaway read retry storms#18
Open
negativeeddy wants to merge 1 commit into
Open
feat: add MakeMKV I/O watchdog to prevent runaway read retry storms#18negativeeddy wants to merge 1 commit into
negativeeddy wants to merge 1 commit into
Conversation
Adds MakemkvIoWatchdog, a BackgroundService that monitors makemkvcon process I/O via /proc/[pid]/io and cancels jobs that exceed a configurable threshold (default 150 GiB). This prevents scratched or damaged discs from saturating container I/O and starving the ASP.NET request pipeline. New config settings (ArmSettings): - MakemkvMaxReadBytes (default: 161061273600 = 150 GiB) - MakemkvIoWatchdogIntervalSeconds (default: 30, min: 10) YAML keys: MAKEMKV_MAX_READ_BYTES, MAKEMKV_IO_WATCHDOG_INTERVAL
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.
Problem
The container
vigorous_borgbecame unresponsive becausemakemkvconaccumulated 450GB of block I/O on a single disc. This saturated the storage subsystem, starving SQLite and the ASP.NET request pipeline, causing the web UI to deadlock.Solution
A new
MakemkvIoWatchdogbackground service that monitorsmakemkvconprocess I/O via/proc/[pid]/ioand cancels jobs that exceed a configurable threshold.Changes
New file
src/ArmRipper.Core/Infrastructure/MakemkvIoWatchdog.cs—BackgroundServicethat:read_bytes) from/proc/[pid]/iopermakemkvconprocessBackgroundRipService.CancelRip()→ CTS token cascade →CliProcessRunner.Kill(entireProcessTree: true)/proc/[pid]/cmdlineto map the process to the correct jobkill -TERMif no matching job can be foundMakemkvMaxReadBytes = 0or on non-LinuxModified files
ArmSettings.cs— AddedMakemkvMaxReadBytes(default: 150 GiB) andMakemkvIoWatchdogIntervalSeconds(default: 30)ArmYamlConfigLoader.cs— Added YAML key mappings forMAKEMKV_MAX_READ_BYTESandMAKEMKV_IO_WATCHDOG_INTERVALProgram.cs(WebUi) — RegisteredMakemkvIoWatchdogas a hosted serviceBuild
Config example (arm.yaml)
Set
MAKEMKV_MAX_READ_BYTES: 0to disable.Closes the I/O watchdog item from the
vigorous_borginvestigation.