Bug 2243 - Look for new and changed music - scan never completes
: Look for new and changed music - scan never completes
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Database
: 6.2.0
: All Linux (other)
: P2 normal (vote)
: ---
Assigned To: Dan Sully
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-03 13:23 UTC by Adrian Smith
Modified: 2011-03-16 04:19 UTC (History)
0 users

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Smith 2005-10-03 13:23:19 UTC
Svn 4508, "look for new and changed muscic" does not complete.  It stops using 
cpu time, but stays in "SlimServer is still scanning your music library".  
Complete scan is OK.  

Looks like it is including an artScan which does not progress?

<snip from scan of music>
2005-10-03 21:14:42.6524 Import: Completed Folder Scan in 0 seconds.
2005-10-03 21:14:42.6535 Adding task for artScan().
2005-10-03 21:14:42.6543 Adding task for mergeVariousArtistsAlbums().
2005-10-03 21:14:42.6551 Import: Finished background scanning.
2005-10-03 21:14:42.6713 Import: Adding task for cleanupStaleTrackEntries()..
2005-10-03 21:14:42.8113 Import: Starting db garbage collection..
2005-10-03 21:14:42.8156 Import: Finished with mergeVariousArtistsAlbums()
2005-10-03 21:14:43.0415 Import: Finished with stale track cleanup. Adding 
tasks for Contributors, Albums & Genres.
2005-10-03 21:14:43.0534 Import: Starting stale cleanup for class 
Slim::DataStores::DBI::Contributor / contributorTracks
2005-10-03 21:14:43.0754 Import: Finished stale cleanup for class 
Slim::DataStores::DBI::Contributor / contributorTracks
2005-10-03 21:14:43.0864 Import: Starting stale cleanup for class 
Slim::DataStores::DBI::Album / tracks
2005-10-03 21:14:43.1083 Import: Finished stale cleanup for class 
Slim::DataStores::DBI::Album / tracks
2005-10-03 21:14:43.1193 Import: Starting stale cleanup for class 
Slim::DataStores::DBI::Genre / genreTracks
2005-10-03 21:14:43.1355 Import: Finished with cleanupStaleTableEntries()
2005-10-03 21:15:11.1158 Import: Scanning with 1 import plugins
2005-10-03 21:15:11.1167        Artwork scan started at: Mon Oct  3 21:14:42 
2005
2005-10-03 21:15:11.1173 
2005-10-03 21:16:44.0720 Import: Scanning with 1 import plugins
2005-10-03 21:16:44.0734        Artwork scan started at: Mon Oct  3 21:14:42 
2005
2005-10-03 21:16:44.0740 
2005-10-03 21:16:44.3116 Import: Scanning with 1 import plugins
2005-10-03 21:16:44.3128        Artwork scan started at: Mon Oct  3 21:14:42 
2005
2005-10-03 21:16:44.3136 
<above message repeated.....>
Comment 1 Dan Sully 2005-10-03 13:38:28 UTC
Can you run with --d_artwork?
Comment 2 Adrian Smith 2005-10-03 13:47:34 UTC
Looks like the artScan task completes without clearing state:

[slimserver@vig ~]$ ./slimserver.pl --d_import --d_artwork --d_scheduler
2005-10-03 21:43:14.5004 Import: Adding Folder Scan
2005-10-03 21:43:14.5012 Import: Adding Playlist Scan
2005-10-03 21:43:37.6343 Import: Wiped all in-memory caches.
2005-10-03 21:43:37.6590 Import: Starting Playlist scan
2005-10-03 21:43:37.6971 Adding task: CODE(0x894373c) ARRAY(0x9163b98)
2005-10-03 21:43:37.6975 Adding taskptr: ARRAY(0x9168f20)
2005-10-03 21:43:37.6979 Import: Starting Folder scan
2005-10-03 21:43:37.7225 Adding task: CODE(0x894373c) ARRAY(0x8cf7530)
2005-10-03 21:43:37.7228 Adding taskptr: ARRAY(0x9f2d6f4)
2005-10-03 21:43:38.1318 Import: Completed Playlist Scan in 0 seconds.
2005-10-03 21:43:38.1325 TASK FINISHED: CODE(0x894373c)
2005-10-03 21:43:38.3422 Import: Completed Folder Scan in 0 seconds.
2005-10-03 21:43:38.3427 Adding task for artScan().
2005-10-03 21:43:38.3432 Adding task: CODE(0x9160d68)
2005-10-03 21:43:38.3435 Adding taskptr: ARRAY(0x9f2e198)
2005-10-03 21:43:38.3439 Adding task for mergeVariousArtistsAlbums().
2005-10-03 21:43:38.3444 Adding task: CODE(0x9f58368)
2005-10-03 21:43:38.3447 Adding taskptr: ARRAY(0xa092b78)
2005-10-03 21:43:38.3451 Import: Finished background scanning.
2005-10-03 21:43:38.3614 Import: Adding task for cleanupStaleTrackEntries()..
2005-10-03 21:43:38.3620 Adding task: CODE(0x98a8fbc) 
Slim::DataStores::DBI::DBIStore=HASH(0x988cbc0)
2005-10-03 21:43:38.3624 Adding taskptr: ARRAY(0xa092b30)
2005-10-03 21:43:38.3629 TASK FINISHED: CODE(0x894373c)
2005-10-03 21:43:38.3639 TASK FINISHED: CODE(0x9160d68)
2005-10-03 21:43:38.5071 Import: Starting db garbage collection..
2005-10-03 21:43:38.5104 Import: Finished with mergeVariousArtistsAlbums()
2005-10-03 21:43:38.5109 TASK FINISHED: CODE(0x9f58368)
2005-10-03 21:43:38.7291 Import: Finished with stale track cleanup. Adding 
tasks for Contributors, Albums & Genres.
2005-10-03 21:43:38.7299 Adding task: CODE(0x98abbd4) 
Slim::DataStores::DBI::DBIStore=HASH(0x988cbc0)
2005-10-03 21:43:38.7303 Adding taskptr: ARRAY(0x9f013b4)
2005-10-03 21:43:38.7307 TASK FINISHED: CODE(0x98a8fbc)
2005-10-03 21:43:38.7410 Import: Starting stale cleanup for class 
Slim::DataStores::DBI::Contributor / contributorTracks
2005-10-03 21:43:38.7617 Import: Finished stale cleanup for class 
Slim::DataStores::DBI::Contributor / contributorTracks
2005-10-03 21:43:38.7724 Import: Starting stale cleanup for class 
Slim::DataStores::DBI::Album / tracks
2005-10-03 21:43:38.7940 Import: Finished stale cleanup for class 
Slim::DataStores::DBI::Album / tracks
2005-10-03 21:43:38.8048 Import: Starting stale cleanup for class 
Slim::DataStores::DBI::Genre / genreTracks
2005-10-03 21:43:38.8208 Import: Finished with cleanupStaleTableEntries()
2005-10-03 21:43:38.8214 TASK FINISHED: CODE(0x98abbd4)
2005-10-03 21:45:17.8301 Import: Scanning with 1 import plugins
2005-10-03 21:45:17.8307        Artwork scan started at: Mon Oct  3 21:43:38 
2005
2005-10-03 21:45:17.8310 
Comment 3 Dan Sully 2005-10-03 13:51:06 UTC
It should be though - it calls endImport('artwork'); at line 235 in Slim/Music/Import.pm

Run with --d_import too?
Comment 4 Adrian Smith 2005-10-03 13:55:36 UTC
[slimserver@vig ~]$ ./slimserver.pl --d_import --d_artwork --d_scheduler --
d_import
2005-10-03 21:52:29.1215 Import: Adding Folder Scan
2005-10-03 21:52:29.1224 Import: Adding Playlist Scan
2005-10-03 21:53:30.9534 Import: Wiped all in-memory caches.
2005-10-03 21:53:30.9780 Import: Starting Playlist scan
2005-10-03 21:53:31.0467 Adding task: CODE(0x8943118) ARRAY(0x9163744)
2005-10-03 21:53:31.0470 Adding taskptr: ARRAY(0x9168c34)
2005-10-03 21:53:31.0474 Import: Starting Folder scan
2005-10-03 21:53:31.0720 Adding task: CODE(0x8943118) ARRAY(0x8cf737c)
2005-10-03 21:53:31.0725 Adding taskptr: ARRAY(0x9f8074c)
2005-10-03 21:53:31.4850 Import: Completed Playlist Scan in 0 seconds.
2005-10-03 21:53:31.4857 TASK FINISHED: CODE(0x8943118)
2005-10-03 21:53:31.6950 Import: Completed Folder Scan in 0 seconds.
2005-10-03 21:53:31.6956 Adding task for artScan().
2005-10-03 21:53:31.6960 Adding task: CODE(0x9160a74)
2005-10-03 21:53:31.6964 Adding taskptr: ARRAY(0x9f80644)
2005-10-03 21:53:31.6967 Adding task for mergeVariousArtistsAlbums().
2005-10-03 21:53:31.6972 Adding task: CODE(0x9e6925c)
2005-10-03 21:53:31.6976 Adding taskptr: ARRAY(0x9f9a3e8)
2005-10-03 21:53:31.6979 Import: Finished background scanning.
2005-10-03 21:53:31.7078 Import: Adding task for cleanupStaleTrackEntries()..
2005-10-03 21:53:31.7084 Adding task: CODE(0x98a8bf4) 
Slim::DataStores::DBI::DBIStore=HASH(0x988f588)
2005-10-03 21:53:31.7088 Adding taskptr: ARRAY(0x9f98c84)
2005-10-03 21:53:31.7093 TASK FINISHED: CODE(0x8943118)
2005-10-03 21:53:31.7103 TASK FINISHED: CODE(0x9160a74)
2005-10-03 21:53:31.8528 Import: Starting db garbage collection..
2005-10-03 21:53:31.8561 Import: Finished with mergeVariousArtistsAlbums()
2005-10-03 21:53:31.8566 TASK FINISHED: CODE(0x9e6925c)
2005-10-03 21:53:32.0813 Import: Finished with stale track cleanup. Adding 
tasks for Contributors, Albums & Genres.
2005-10-03 21:53:32.0821 Adding task: CODE(0x98ab80c) 
Slim::DataStores::DBI::DBIStore=HASH(0x988f588)
2005-10-03 21:53:32.0825 Adding taskptr: ARRAY(0x9f81e7c)
2005-10-03 21:53:32.0829 TASK FINISHED: CODE(0x98a8bf4)
2005-10-03 21:53:32.0937 Import: Starting stale cleanup for class 
Slim::DataStores::DBI::Contributor / contributorTracks
2005-10-03 21:53:32.1143 Import: Finished stale cleanup for class 
Slim::DataStores::DBI::Contributor / contributorTracks
2005-10-03 21:53:32.1248 Import: Starting stale cleanup for class 
Slim::DataStores::DBI::Album / tracks
2005-10-03 21:53:32.1462 Import: Finished stale cleanup for class 
Slim::DataStores::DBI::Album / tracks
2005-10-03 21:53:32.1567 Import: Starting stale cleanup for class 
Slim::DataStores::DBI::Genre / genreTracks
2005-10-03 21:53:32.1725 Import: Finished with cleanupStaleTableEntries()
2005-10-03 21:53:32.1732 TASK FINISHED: CODE(0x98ab80c)
2005-10-03 21:55:17.0255 Import: Scanning with 1 import plugins
2005-10-03 21:55:17.0261        Artwork scan started at: Mon Oct  3 21:53:31 
2005
2005-10-03 21:55:17.0263 
Comment 5 Adrian Smith 2005-10-03 14:08:20 UTC
For my test example (one album), artScan returns at:
my $album  = $albums[0] || return 0;

Hence endImporter('artwork'); never gets called.
Comment 6 Adrian Smith 2005-10-03 14:12:55 UTC
How about:
--- trunk/server/Slim/Music/Import.pm   2005-09-21 20:05:21.000000000 +0100
+++ Slim/Music/Import.pm        2005-10-03 22:11:16.000000000 +0100
@@ -216,10 +216,17 @@
 }
 
 sub artScan {
-       my @albums = keys %artwork;
-       my $album  = $albums[0] || return 0;
-
        my $ds     = Slim::Music::Info::getCurrentDataStore();
+
+       if (!%artwork) { 
+               $::d_artwork && msg("Completed Artwork Scan\n");
+               endImporter('artwork');
+               $ds->forceCommit();
+               return 0;
+       }
+
+       my @albums = keys %artwork;
+       my $album  = $albums[0];
        my $track  = $ds->objectForId('track', $artwork{$album}); 
 
        # Make sure we have an object for the url, and it has a thumbnail.
@@ -230,12 +237,6 @@
 
        delete $artwork{$album};
 
-       if (!%artwork) { 
-               $::d_artwork && msg("Completed Artwork Scan\n");
-               endImporter('artwork');
-               $ds->forceCommit();
-               return 0;
-       }
 
        return 1;
 }
Comment 7 Dan Sully 2005-10-03 14:15:04 UTC
Ok - just checked in a fix. Give it a go?
Comment 8 Dan Sully 2005-10-03 14:15:11 UTC
Ok - just checked in a fix. Give it a go?
Comment 9 KDF 2005-10-03 14:16:17 UTC
ow...my head hurts...
Comment 10 KDF 2005-10-03 14:20:09 UTC
dan, your fix will still ignore any album with an id of '0'.  perhaps if
(defined $album) would work better.  That, or don't check on album, and simply
verify that we have a track object or skip to the delete.
Comment 11 Dan Sully 2005-10-03 14:24:03 UTC
Done.
Comment 12 Adrian Smith 2005-10-03 14:28:12 UTC
Crashes!  $ds is not defined in the if (!%artwork) - should be outside the if..
[I liked my patch better!]
Comment 13 Dan Sully 2005-10-03 14:38:27 UTC
Heh, ok - go ahead and implement your patch. :)
Comment 14 Adrian Smith 2005-10-03 14:42:07 UTC
I've compromised on updating yours.  Thanks for the help on this.
Comment 15 Chris Owens 2006-06-16 14:41:33 UTC
There are 536 bugs in the database with targets of '---' that were fixed prior to new year 2006.  I am setting them to targets of 6.2.1 to keep them from showing up in my queries.