Triggering proper shutdown routine

Get help with all aspects of 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
lief
Newbie
Newbie
Posts: 3
Joined: May 2nd, 2013, 10:28 pm

Triggering proper shutdown routine

Post by lief »

I am concerned about the shutdown procedure followed by sanzbd when my computer shutdowns or restarts. Since, sabnzbd is simply running as a process (not from source .py) as oppose to a windows service, how does sabnzbd handles such a situation? Does windows somehow informs the main sabnzbd process to execute proper shutdown operation or does it kill the sabnzbd process instantaneously? If latter is the case, won't that cause corruption of downloaded data and how can I rectify this issue?

I don't have any problem with sickbeard or couchpotato as they are just snatchers.

Thanks for your time
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Triggering proper shutdown routine

Post by shypike »

If in the middle of post-processing, Windows will not have enough patience and abort it.
When downloading, SABnzbd will want to flush its article cache to disk, which takes time too.
How much damage this does, is just a gamble.
The current job could be damaged, usually repairable.
Having said that, my test releases crash often and a never see that much damage.

Do you often just shutdown or restart your computer when SABnzbd is active?
Is it not option to pause SABnzbd first?
lief
Newbie
Newbie
Posts: 3
Joined: May 2nd, 2013, 10:28 pm

Re: Triggering proper shutdown routine

Post by lief »

Since SABnzbd runs in the background (pseudo-daemon??), it is not feasible to always pause or shutdown SABnzbd manually. For example - if I am installing some software and asked to restart the computer, I am sure, I will hardly remember to shutdown SABnzbd.

Is there any way to achieve such functionality? Will running SABnzd as a windows service (true-daemon mode??) help?
Not surprisingly, now that I have thought of this issue with SABnzbd, I wonder do utorrent, IDM, portable apps etc fall victim to similar treatment?

I am currently learning Android Programming and I am totally impressed by the life-cycle and robust event system of the activities. There we are given the opportunity to handle above mention issues in the form of onDestroy() etc methods.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Triggering proper shutdown routine

Post by shypike »

lief wrote: Is there any way to achieve such functionality? Will running SABnzd as a windows service (true-daemon mode??) help?
Not surprisingly, now that I have thought of this issue with SABnzbd, I wonder do utorrent, IDM, portable apps etc fall victim to similar treatment?
A Windows Service will get more slack from Windows at shutdown time.
Minimizing your cache article cache will speed up SABnzbd own shutdown.
Of course SABnzbd can be made to use less time on shutdown, but its performance
would be seriously affected (because of the constant disk access).
Aborting post-processing is relatively safe, although it unavoidably leaves debris behind in the destination folder.
Post-processing will be automatically retried when restarting.

Android programs seldom have to do a lot when they shutdown.
Which Android program has to dump 200MBytes to a hard disk? :)
Even Android has a limit to the time it waits: you wouldn't like it when shutdown took 10 minutes.
Post Reply