Hi Niphlod,
If I could add to the questions (I'm having some success with the scheduler 
but there's a few gaps in my understanding):
What process removes the rows from the scheduler_worker table ?  
Does it make any difference to Kill a worker by updating it's status or by 
just Ctl-C (Or closing the window in Windows) to stop the task ?
 
I have one worker row with a status of KILL.  The scheduler worker process 
has stopped correctly.   Does there need to be at least one active worker 
to clean up this table ?  Will this row be removed when I restart a worker 
instance?
 
What happens when I have several Assigned Tasks, but the worker to which 
they are assigned is Killed ?  Will they be reassigned automatically ?  
 
Does KILLing a worker terminate the task that the worker is running as well 
as the specific worker instance ?  I expect so but to be clear there are 
two things running - the worker instance, and the specific task that the 
worker has initiated.   Some of the wording talks about the worker task, 
but is that referring to both or just one of these two processes ?
 
Probably just a general web2py question, but I have a menu item that calls 
a controller which runs " scheduler.queue_task(...." .  Unfortunately I get 
two rows inserted into scheduler_task and i can't work out why.  The 
controller appears to be called twice.  
 
Thanks

On Thursday, October 3, 2013 12:13:50 AM UTC+10, Niphlod wrote:

>
>
> Il giorno mercoledì 2 ottobre 2013 15:15:16 UTC+2, Marin Pranjić ha 
> scritto: 
>>
>> Hi,
>>
>> I have a task queue that runs in the background. I want to switch to 
>> scheduler because I need more workers.
>> Queued tasks are long running (video transcoding, 10-20 minutes each).
>>
>> 1. If I terminate (Ctrl+C) scheduler process, scheduler_run record is 
>> STOPPED and scheduler_task record is back to QUEUED status. That's cool.
>> What happens if there is a system failure or power supply loss? Is the 
>> record stuck at RUNNING or is there a mechanism that 'fixes' invalid state 
>> once scheduler is up again?
>> This is likely to happen multiple times.
>>
>
> How do you handle it is up to you. schedule a task that inspects what has 
> been done by your task, eventually prune temporary files, reschedule the 
> task, do whatever you need. There's no limits in configuration because 
> anyone needs different type of tasks ("retry blindly" vs "stop and warn me" 
> approaches are very different and scheduler doesn't pose a limit on those). 
> However in that particular case (assuming your using a TIMEOUT, which you 
> definitely **should**) tasks in RUNNING will be marked as TIMEOUT.
>  
>
>>
>> 2. Is there a way of stopping a task without terminating a worker?
>>
>>
> Nope, but it's not that hard to schedule the os to restart a worker if 
> it's killed, and it's a task better handled separately (attached processes, 
> zombie resources, etc). 
> If you follow the deployment config with upstart as soon as it's killed it 
> restarts automatically.
>  
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to