feat(arrs): unified queue auto-cleanup with failure circuit breaker, Force Stop; dead-code sweep + health UI tidy#659
Merged
Conversation
…e sweep + health UI tidy Combined change set: the arrs queue auto-cleanup feature plus a repo-wide dead-code sweep and theme-consistency pass on the health UI. Tree is build- and test-verified as a whole (go build/tests, bun check, vite build). See PR description for details.
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
Two related bodies of work, build- and test-verified together (
go build+ full test suite,bun run check, vite production build):1. Unified queue auto-cleanup (all six *arrs)
One cleanup pass per tick covers Radarr, Sonarr, Whisparr, Lidarr, Readarr and Sportarr (
internal/arrs/worker/stuck_cleanup.go), replacing the per-type scaffold and the separate Import Failure Cleanup toggle:remove/blocklist/blocklist_search, editable in the Arrs settings UI; rule actions are validated on config load and API savearrs.queue_cleanup_grace_period_minutes, so transient errors the *arr resolves on its own are left alonePer-target failure circuit breaker
arrs.queue_cleanup_max_failures(0 = off) counts AltMount-initiated actions per target (movie / episode / album / book) in a shared in-memory tracker (internal/arrs/failures) so a dead release cannot drive an endless grab → fail → re-grab loop. Three producers bump the same keys:worker.HandleImportFailure) — catches the fast-fail loop where the *arr blocklists one GUID and instantly re-grabs the same release from another indexer; at the threshold the target is unmonitored first, then the queue record is removed with blocklist + skipRedownloadCounters reset when the target later imports healthy. In-memory only; clears on restart.
Force Stop brake
Emergency pause (API:
GET/POST/DELETE /api/arrs/pause; UI control in the Queue page cleanup dropdown). While engaged, no *arr requests are issued: the cleanup tick, health-repair re-trigger, importer failure breaker and the indexer history sync all gate on it.Related fixes
config.sample.yamlupdated for the new options2. Dead-code sweep + health UI tidy
Dead code removal (every removal verified by build + tests):
RCloneConfigSection,ManualScanSection,ActiveStreamsCard,RecentCompletions,HealthChart,QueueChart,KeyValueEditor, plus unused exports inErrorAlert,LoadingSpinner,BytesDisplay,useConfig,webdavClient, api client/typesinternal/library(entire package), api/webdav auth_updaters, unused metadata/importer/utils/slogutil/encryption helpers, fuse server and rclonecli mount leftovers, unused API response helpers and routesinternal/database/testing.go→testing_test.go(test-only helper no longer ships in the production build)Health UI tidy — replace hardcoded tailwind palette colors (teal/emerald/amber/rose + rgba glows) with daisyUI theme tokens so the health pages follow the active theme:
success/warning/errortokens for the three performance tiers, muted failure bar on excellent indexers, sort preference persisted in localStorage, best/worst chips and the comparison bar chart removed (low signal next to the per-indexer cards)hsl()tooltip), provider table badges and quota vials themed via base/success/warning/error tokensTest plan
go build ./...+ full Go test suite green (new tests: failures tracker, worker breaker, import-failure flow with httptest fake Sonarr, registrar client matching, config validation)bun run check+ vite production build green