Skip to content

Fix SQLite contention during import-list sync - #5

Open
johoja12 wants to merge 12 commits into
realzombee:developfrom
johoja12:fix/import-list-sync-db-lock
Open

Fix SQLite contention during import-list sync#5
johoja12 wants to merge 12 commits into
realzombee:developfrom
johoja12:fix/import-list-sync-db-lock

Conversation

@johoja12

@johoja12 johoja12 commented Aug 16, 2026

Copy link
Copy Markdown

Summary

  • serialize per-list fetch and parse processing
  • skip unchanged import-list mappings and library-cleanup writes
  • coordinate SQLite repository writes and extend the busy timeout to 5 seconds
  • keep ImportListSync type-exclusive while allowing it to run alongside long-running refresh commands

Problem

Large import-list syncs created overlapping SQLite writer and reader windows. The prior queue-only patch avoided one collision but did not cover concurrent per-list processing or long refresh work.

Testing

  • Focused datastore and import-list suite: 58 passed, 0 failed
  • Release Core build: 0 warnings, 0 errors
  • Production Radarr 4K validation: Indian, Kids, and Movies were enabled one at a time; each completed staged scheduled syncs alongside RefreshMovie with zero new database-is-locked or SQLite Busy logs.

@johoja12

Copy link
Copy Markdown
Author

Updated with 7df4bfa: queue persistence now waits for an active exclusive command before writing command records. Added single and batch persistence regressions (11 focused command-queue tests pass) and built against Radarr 6.5.1.2032.\n\nProduction Radarr4K canary showed zero fresh SQLite lock errors. The enabled RadarrIndian sync then stalled in its remote-fetch phase, so it was paused again and the service was left healthy with all import lists disabled. This is distinct from the original concurrent SQLite writer failure.

@johoja12

Copy link
Copy Markdown
Author

Follow-up production canary: enabling all three Radarr import lists still produced SQLite Busy errors, now traced inside FetchAndParseImportListService parallel list workers while syncing RadarrKids (ImportListMovieService.SyncMoviesForList). This is separate from command-queue persistence; the current patch prevents the latter but is not sufficient for all-list concurrency. I re-paused all three lists and verified a clean post-restart scheduler cycle with zero new locks.

@johoja12 johoja12 changed the title Fix import list sync command serialization Fix SQLite contention during import-list sync Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant