Long 'Repair > Starting Repair' phase for large nzb's

Report & discuss bugs found in SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
Zazz
Newbie
Newbie
Posts: 1
Joined: June 10th, 2011, 4:36 am

Long 'Repair > Starting Repair' phase for large nzb's

Post by Zazz »

Version 0.6.4 on Ubuntu 11.04 'Natty'.

After downloading a nzb consisting of 20 50 file rarsets, I noticed the 'Repair > Staring Repair' message lingering for multiple minutes.
Some checking of the log files showed this to be related to the sabnzbd.newsunpack.build_filelists method. While there is a check_rar parameter, that only seems to apply to the joinables array, with every candidate for the rars array still being verified.
This would create a small but significant delay on a single 1000 file rar set, but there being 20 results in this operation being performed an additional 19 times.

Replacing (line 1217)

Code: Select all

rars = [f for f in filelist if RAR_RE.search(f) and is_rarfile(f)]
with

Code: Select all

if check_rar:
    rars = [f for f in filelist if RAR_RE.search(f) and is_rarfile(f)]
else:
    rars = [f for f in filelist if RAR_RE.search(f)]
solved the problem for me, but I haven't spent enough time with the sabnzbd code to know if this change would break anything.

A more solid solution would probably be to change the is_rarfile method or create a wrapper method to add some elementary caching of results.

As I'm running some unholy VMware ESXi + Solaris + ZFS + NFS + Ubuntu hybrid, I realize this might not be a problem in most other use cases, but I hope you can still take a look at it.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Long 'Repair > Starting Repair' phase for large nzb's

Post by shypike »

You are right, this implementation is inefficient.
But it's also true that this is only a problem in extreme cases
and even then it's adding minutes to hours, I guess.

I don't know if your fix is acceptable.
The code needs to cater for some very complex situations
dealing with whether rar segments need to be handled directly
by unrar or by par2-joining.
I'll look into this, but not with a high priority.
Post Reply