Ticket #12 (closed defect: fixed)
SqueezeCenter locks up during a rescan
| Reported by: | stuarth | Owned by: | stuarth |
|---|---|---|---|
| Priority: | major | Milestone: | Release v1.0 |
| Component: | Plugin | Version: | 1.0 |
| Keywords: | Cc: |
Description
Reported by A. Torgovitsky and Peter Oliver, and Peter describes the problem clearly:
I recently updated to AutoRescan? v1.0b5, and I find that every time I change a file under the music directory, Squeezecenter CPU usage jumps up to 100% for serveral minutes, during which music playback ceases, the web interface fails to load pages, the Controller disconnects, etc. This is becuase Slim::Schema->cleanupStaleTrackEntries appears to scans every single file in the database, which is very expensive with a large music collection on slowish hardware. During a usual rescan this would happen in a seperate process, but for an auto-rescan it runs in the main process and blocks all other activity until it completes.
Change History
comment:1 Changed 3 years ago by stuarth
- Status changed from new to assigned
- Version set to 1.0
- Milestone set to Release v1.0
comment:2 Changed 3 years ago by stuarth
The plugin could also watch the playlist directory separately and, if that changes, trigger a rescan of just the playlists.
comment:4 Changed 3 years ago by stuarth
Test implementation in r432. Not yet tested and does not yet contain the code to actually trigger a rescan (only to detect it).

This is correct - all rescanning kicked off from the plugin runs in the same process as the server. I've an alternative idea, though...
This has the disadvantage that it is effectively performing a full scan rather than being targetted at the changes, and so it'll take longer. However, it will run in the background and should actually simplify the plugin since it won't have to try to clean up stale tracks etc.