Page 1 of 1

Deleting item from queue orphans some associated cache files

Posted: June 15th, 2008, 2:14 am
by onebinary
Environment Info:
SABnzbd 0.4.0RC2
Ubuntu Linux 8.04 Hardy Heron 64bit
Default Skin

Issue: When you delete an item from the queue, some cache files get orphaned in the cache directory and are never cleaned up, even upon using the Shutdown feature.

Steps to Reproduce:
- (On Linux) start SABnzbd with an empty queue and a clean cache directory (just the 3 .sab files).
- Begin a download, preferrably something large that has large files (a download split into 50MB rar files is a good choice).
- Let the download run for a few minutes so that you build up some cache files.
- Hit the Del button in the interface to delete the item from the queue.
- Look at your cache directory, there should be some SABnzbd_article_* files left.
- Use the Shutdown feature in the UI.
- Look at cache directory again and you should (hopefully) see the orphaned cache files.

Cache directory output:
The first listing is after deleting from the queue.  The second listing is after shutdown:

Code: Select all

onebinary@home:/data/sabnzbd/cache$ ls -ltr
total 1308
-rw-r--r-- 1 onebinary users       1599 2008-06-14 23:48 rss_data.sab
-rw-r--r-- 1 onebinary users         11 2008-06-14 23:48 bytes7.sab
-rw-r--r-- 1 onebinary users      36802 2008-06-14 23:49 queue7.sab
-rw------- 1 onebinary onebinary 640000 2008-06-14 23:49 SABnzbd_article_zoFYyO
-rw------- 1 onebinary onebinary 640000 2008-06-14 23:49 SABnzbd_article_nAu5j9
onebinary@home:/data/sabnzbd/cache$ ls -ltr
total 1308
-rw------- 1 onebinary onebinary 640000 2008-06-14 23:49 SABnzbd_article_zoFYyO
-rw------- 1 onebinary onebinary 640000 2008-06-14 23:49 SABnzbd_article_nAu5j9
-rw-r--r-- 1 onebinary users       1599 2008-06-14 23:50 rss_data.sab
-rw-r--r-- 1 onebinary users      36802 2008-06-14 23:50 queue7.sab
-rw-r--r-- 1 onebinary users         11 2008-06-14 23:50 bytes7.sab
Debug Log: I can't seem to find a specific log entry that documents when the item was removed from the queue.  I'm assuming that the queue save line I'm snipping from was when the deletion occurred?

Code: Select all

2008-06-14 23:49:54,273::INFO::[nzbqueue] Saving queue
2008-06-14 23:49:54,273::INFO::[sabnzbd] Saving data for queue7.sab in /data/sabnzbd/cache/queue7.sab
2008-06-14 23:49:54,511::DEBUG::[downloader] bps: 412705.660981
2008-06-14 23:49:55,449::INFO::[downloader] Thread [email protected]:8080: part8of24.GthhcK&[email protected] done
2008-06-14 23:49:55,449::INFO::[decoder] Decoding <Article: article=part8of24.GthhcK&[email protected], bytes=661200, partnum=8, art_id=None>
2008-06-14 23:49:55,455::INFO::[articlecache] <Article: article=part8of24.GthhcK&[email protected], bytes=661200, partnum=8, art_id=None> would be discarded
2008-06-14 23:49:55,456::INFO::[articlecache] <Article: article=part8of24.GthhcK&[email protected], bytes=661200, partnum=8, art_id=None> would be discarded
2008-06-14 23:49:55,456::INFO::[articlecache] Flushing <Article: article=part8of24.GthhcK&[email protected], bytes=661200, partnum=8, art_id=SABnzbd_article_zoFYyO> to disk
2008-06-14 23:49:55,456::DEBUG::[articlecache] cache_size -> 0
2008-06-14 23:49:55,456::INFO::[sabnzbd] Saving data for SABnzbd_article_zoFYyO in /data/sabnzbd/cache/SABnzbd_article_zoFYyO
2008-06-14 23:49:55,458::DEBUG::[nzbqueue] Discarding article part8of24.GthhcK&[email protected], no longer in queue
2008-06-14 23:49:55,713::INFO::[downloader] Thread [email protected]:8080: part9of24.GthhcK&[email protected] done
2008-06-14 23:49:55,714::INFO::[decoder] Decoding <Article: article=part9of24.GthhcK&[email protected], bytes=661932, partnum=9, art_id=None>
2008-06-14 23:49:55,720::INFO::[articlecache] <Article: article=part9of24.GthhcK&[email protected], bytes=661932, partnum=9, art_id=None> would be discarded
2008-06-14 23:49:55,720::INFO::[articlecache] <Article: article=part9of24.GthhcK&[email protected], bytes=661932, partnum=9, art_id=None> would be discarded
2008-06-14 23:49:55,720::INFO::[articlecache] Flushing <Article: article=part9of24.GthhcK&[email protected], bytes=661932, partnum=9, art_id=SABnzbd_article_nAu5j9> to disk
2008-06-14 23:49:55,721::DEBUG::[articlecache] cache_size -> 0
2008-06-14 23:49:55,721::INFO::[sabnzbd] Saving data for SABnzbd_article_nAu5j9 in /data/sabnzbd/cache/SABnzbd_article_nAu5j9
2008-06-14 23:49:55,722::DEBUG::[nzbqueue] Discarding article part9of24.GthhcK&[email protected], no longer in queue
2008-06-14 23:49:59,713::DEBUG::[downloader] bps: 215339.668769
2008-06-14 23:50:04,713::DEBUG::[downloader] bps: 86540.0499296
2008-06-14 23:50:10,713::DEBUG::[downloader] bps: 28982.154419
2008-06-14 23:50:16,713::DEBUG::[downloader] bps: 9706.07143143
2008-06-14 23:50:20,967::INFO::SABnzbd shutting down...

Re: Deleting item from queue orphans some associated cache files

Posted: June 15th, 2008, 3:56 am
by shypike
This is on the to-do list for a later release.

As we are preparing for 0.4.0Final, fixing this would introduce too much risk.
And this "feature" is in all SABnzbd releases.

Re: Deleting item from queue orphans some associated cache files

Posted: April 15th, 2009, 12:22 pm
by Mr. Wilby
Did this ever get fixed?

Re: Deleting item from queue orphans some associated cache files

Posted: April 15th, 2009, 12:33 pm
by shypike
No, planned for after release 0.5.0 (which isn't out yet).
It will get more priority, since it is a real problem.