:)

Because I'm a perfectionist, and I want other developers to be able to 
install my system by just unzipping the code, running ./serve, and have it 
just work. So I want to use the built-in webserver and scheduler. There's 
no reason they shouldn't be able to manage these race conditions correctly.

I'm super excited that the Ctrl-C bug was fixed!

Your idea of putting the initializer in the @cron reboot is very appealing! 
I will think about this and see if I can come up with a nice solution with 
it. Ideally I could re-use this "daemon_task" setup for other projects as 
well, as I find it to be a quite common scenario. I understand you do not 
find it to be common. I am not sure why we have different experiences.

Would portalocker be a good thing to use for this situation? I would like 
to be cross-platform instead of relying on postgres locks.

On Wednesday, June 27, 2012 12:37:27 PM UTC-7, Niphlod wrote:
>
> uhm..... why not having them started with systemd or upstart or 
> supervisord ?
>
> Scheduler is "by design" allowed to run with multiple instances (to 
> process a longer queue you may want to start more of them), but if you're 
> really loosing money why didn't you rely on that services to be sure that 
> there's only one instance running?
> There are a looooot of nice implementations out there and the one I 
> mentioned are pretty much "state-of-the-art" :D (while contributing to fix 
> current issues)
>
> BTW: - "responding to ctrl+c" fixed in trunk recently 
>            - "os messed up maybe" require you to check the os, python 
> programs can't be omniscient :D
>            - "messy developers", no easy fix for that too 
>
>
> On Wednesday, June 27, 2012 9:18:06 PM UTC+2, Michael Toomim wrote:
>>
>> The problem with terminating the processes is:
>>   • sometimes they don't respond to control-c, and need a kill -9
>>   • or sometimes that doesn't work, maybe the os is messed up
>>   • or sometimes the developer might run two instances simultaneously, 
>> forgetting that one was already running
>>
>> You're right that usually I can shut them both down with control-c, but I 
>> need a safeguard. My application spends money on mechanical turk and I'll 
>> spend erroneous money and upset my users if it goes wrong by accident.
>>
>> On Wednesday, June 27, 2012 12:56:52 AM UTC-7, Niphlod wrote:
>>>
>>> BTW: I'm pretty sure that when you say "scheduler should be terminated 
>>> alongside web2py" you're not perfectly grasping how webdevelopment in 
>>> production works. If you're using "standalone" versions, i.e. not mounted 
>>> on a webserver, you can start your instances as web2py -a mypassword & 
>>> web2py -K myapp and I'm pretty sure when hitting ctrl+c both will shutdown. 
>>>
>>

Reply via email to