Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #12 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

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

This is correct - all rescanning kicked off from the plugin runs in the same process as the server. I've an alternative idea, though...

  1. If the plugin notices changes that require a rescan then it schedules a delayed callback to itself. If another change is noticed it replaces that with another - thus the callback only happens a short time after the last change if they're close together (need a delay parameter there to control that).
  2. The callback checks to see if there is still currently a scan taking place - if so it schedules another delayed callback (ie it puts off the work a bit longer - probably by the same delay about as the above point).
  3. When no scan is noticed the plugin kicks off a "find new and changed music" normal rescan. This should be done in the same way as the normal settings page in SC and so it should happen in a background process.

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.

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:3 Changed 3 years ago by stuarth

This has also been reported in this forum thread:

 http://forums.slimdevices.com/showthread.php?t=55819

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).

comment:5 Changed 3 years ago by stuarth

  • Status changed from assigned to closed
  • Resolution set to fixed

This has now been completed for 1.0b6 in r430.

comment:6 Changed 3 years ago by stuarth

Sorry - I meant that this was in r433.

Note: See TracTickets for help on using tickets.