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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to