Page 1 of 1
Triggering proper shutdown routine
Posted: May 6th, 2013, 8:59 am
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
Re: Triggering proper shutdown routine
Posted: May 6th, 2013, 9:45 am
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?
Re: Triggering proper shutdown routine
Posted: May 6th, 2013, 11:40 am
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.
Re: Triggering proper shutdown routine
Posted: May 6th, 2013, 12:02 pm
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.