Page 1 of 1

Scheduler and enable/disable server

Posted: February 21st, 2012, 10:15 am
by Brucia_Willis
I don't know if this can be qualified as a bug or it is indeed how it's supposed to work, but the scheduler doesn't work how i want it to (and i think how it should be supposed to) when enabling/disabling servers.

To make it brief: if for whatever reason sabnzbd is closed/shutdown say at 11:00, there's a scheduled enable server at 11:20, and I startup sabnzbd again later at 11:30, the supposed enable_server doesn't happen.
If the computer is on and sabnzbd is running the schedules work fine.
I don't know if this behaviour also applies to pause/speedlimit/resume options of the scheduler, I haven't tried.

I'm using version 0.6.15 (but it happened in 6.9 and 6.10 too) on win7, I installed from zip.
A simple way to reproduce this is shutdown sabnzb, add manually a scheduler enable/disable on the ini and starting sabnzbd.

This is a issue for me because I have a news server that only allows connection overnight (from 2AM to 2PM), and I don't leave my pc always on, so quite often I have to add to the scheduler an enable server to make it work with the side effect of cluttering the scheduler page.

Below is part of the debug log of when i recreated the issue changing the .ini (i snipped some stuff to make it less bulky, if needed i can post the full log)

2012-02-21 15:05:14,111::INFO::[sabnzbd:1207] --------------------------------
2012-02-21 15:05:14,111::INFO::[sabnzbd:1208] SABnzbd.exe-0.6.15 (rev=d06f957a0f05a8766822acaa6de1f6d1e9f279e0)
2012-02-21 15:05:14,178::INFO::[sabnzbd:1216] Platform=Windows-Vista-6.1.7601-SP1 (=Vista+ x64) Class=nt
2012-02-21 15:05:14,178::INFO::[sabnzbd:1221] Python-version = 2.5.5 (r255:77872, Jan 31 2010, 15:49:35) [MSC v.1310 32 bit (Intel)]

2012-02-21 15:05:14,334::DEBUG::[scheduler:123] scheduling disable_server(['reader.extremeusenet.nl']) on days [1, 2, 3, 4, 5, 6, 7] at 14:0
2012-02-21 15:05:14,334::DEBUG::[scheduler:123] scheduling enable_server(['reader.extremeusenet.nl']) on days [1, 2, 3, 4, 5, 6, 7] at 2:1
2012-02-21 15:05:14,334::DEBUG::[scheduler:123] scheduling disable_server(['reader4.xlned.com']) on days [1, 2, 3, 4, 5, 6, 7] at 15:1
2012-02-21 15:05:14,334::DEBUG::[scheduler:136] Scheduling RSS interval task every 180 min (delay=120)
2012-02-21 15:05:14,334::DEBUG::[scheduler:147] Scheduling VersionCheck on day 2 at 21:36
2012-02-21 15:05:14,335::DEBUG::[scheduler:267] Schedule check result = (9296, 'enable_server', 'reader.extremeusenet.nl', '1 2 * enable_server reader.extremeusenet.nl')
2012-02-21 15:05:14,335::DEBUG::[scheduler:267] Schedule check result = (10015, 'disable_server', 'reader.extremeusenet.nl', '0 14 * disable_server reader.extremeusenet.nl')
2012-02-21 15:05:14,335::DEBUG::[scheduler:267] Schedule check result = (10076, 'disable_server', 'reader4.xlned.com', '1 15 * disable_server reader4.xlned.com')
2012-02-21 15:05:14,335::INFO::[downloader:194] Resuming
2012-02-21 15:05:14,335::DEBUG::[__init__:479] PAUSED_ALL inactive
2012-02-21 15:05:14,348::INFO::[__init__:289] All processes started
2012-02-21 15:05:20,118::INFO::[sabnzbd:1471] Starting SABnzbd.exe-0.6.15
2012-02-21 15:05:20,118::DEBUG::[__init__:300] Starting postprocessor

2012-02-21 15:05:25,361::DEBUG::[nzbqueue:419] Resumed nzo: SABnzbd_nzo_nt-qpk
2012-02-21 15:05:27,232::INFO::[downloader:351] 1@reader4.xlned.com:563: Initiating connection
2012-02-21 15:05:28,318::INFO::[downloader:351] 2@reader4.xlned.com:563: Initiating connection
2012-02-21 15:05:29,871::INFO::[downloader:539] Connecting 1@reader4.xlned.com:563 finished
2012-02-21 15:05:29,885::INFO::[downloader:539] Connecting 2@reader4.xlned.com:563 finished
2012-02-21 15:05:32,779::DEBUG::[decoder:92] Decoding <Article: article=in6Cixwe9rKqRDoOAZf2@noid.local, bytes=398570, partnum=3, art_id=None>
2012-02-21 15:05:34,375::DEBUG::[bpsmeter:179] bps: 163315.585919


As you can see, reader4.xlned.com should be disabled, but it actually connects. ??? (the line i added to the ini after i shutdown sabnznd is the one to disable reader4.xlned.com ad 15:01).
In the rest of the log the other server also tries to connect when it should be disabled and gave a 502 error because i can't connect at this hour.

Re: Scheduler and enable/disable server

Posted: February 21st, 2012, 2:03 pm
by shypike
I see that you disable all servers, because reader4.xlned.com only has a disable event.
Generally it's not very useful to have only a disable event.
It looks like when all servers are disabled, SABnzbd still wants to use at least one of them.
That's not correct, obviously.
A work-around would be to never have all servers disabled OR schedule a pause/resume
between the times that all servers are disabled.

I'll see if this can be fixed in the next release.

Re: Scheduler and enable/disable server

Posted: February 21st, 2012, 2:49 pm
by Brucia_Willis
I should have been more clear, my fault: normally reader4.xlned.com is never disabled, i just tried to reproduce the problem using that one. The line disabling xlned was a one time thing to test the problem (i tried also leaving xlned enabled and tinkering on the other server and the same thing happens). The server that needs the enable/disable schedule is reader.extremeusenet.nl

And to be perfectly clear so you have the full picture i have another server set as back-up, so i suppose this one should have kicked in with the other 2 disabled, but it didn't (because xlned wasn't actually disabled by the schedule), there was no trace on the log of any attempt to connect of this 3rd server. Unless i'm missing something ???

Hope this clears everything up, thanks for your attention.

Re: Scheduler and enable/disable server

Posted: February 21st, 2012, 5:24 pm
by shypike
The schedule evaluation at startup does not pass the calculated server status to the downloader.
The downloader already read the server info from the configuration file.
So at startup it will use the situation as it was at the last shutdown.
You will have to wait for release 0.7.0 Alpha1 for a solution, as we don't expect to release another 0.6.x.

Re: Scheduler and enable/disable server

Posted: February 21st, 2012, 7:16 pm
by Brucia_Willis
shypike wrote:The schedule evaluation at startup does not pass the calculated server status to the downloader.
The downloader already read the server info from the configuration file.
So at startup it will use the situation as it was at the last shutdown.
I had a feeling it was something like this.

Thanks a lot and keep up the good work.

Regards