[Twisted-Python] Incorrect "Another twistd server is running..."

2009-07-21 Thread Peter Cai
When my server reboot after an unexpected power cut, supervisord tried to start a twisted app after an unexpected power cut, but it fails because "Another twistd server is running, PID 4607" 4607 is the PID of the twisted app before power cut. After I stopped and restart supervisord, everything is

Re: [Twisted-Python] Incorrect "Another twistd server is running..."

2009-07-21 Thread Jean-Paul Calderone
On Tue, 21 Jul 2009 19:33:26 +0800, Peter Cai wrote: >When my server reboot after an unexpected power cut, >supervisord tried to start a twisted app after an unexpected power cut, >but it fails because "Another twistd server is running, PID 4607" >4607 is the PID of the twisted app before power cu

Re: [Twisted-Python] Incorrect "Another twistd server is running..."

2009-07-21 Thread Simone Deponti
On 07/21/2009 04:06 PM, Jean-Paul Calderone wrote: > This is probably due to. It's > not clear what the best solution is yet. Hi all, In the bug report I see: > after an unclean shutdown by a previous twistd, a new process is > started and is allocat

Re: [Twisted-Python] Incorrect "Another twistd server is running..."

2009-07-21 Thread Christopher Armstrong
On Tue, Jul 21, 2009 at 1:02 PM, Simone Deponti wrote: > On 07/21/2009 04:06 PM, Jean-Paul Calderone wrote: >> This is probably due to.  It's >> not clear what the best solution is yet. > > Hi all, > > In the bug report I see: > >  > after an unclean shutd

Re: [Twisted-Python] OT - adbapi, connection timeouts, mysql - OT

2009-07-21 Thread Werner Thie
Hi Gabriel had the same problem, solved it by having keepalive() called in a LoopingCall(), MySQL sitting at defaults timingwise. DB_DRIVER = "MySQLdb" USERDB_ARGS = { 'host': '', 'db': '', 'user': '', 'passwd': '', 'cp_reconnect': True } storekeeper = StoreKeeper(DB_DRIVER, **U

Re: [Twisted-Python] OT - adbapi, connection timeouts, mysql - OT

2009-07-21 Thread Clay Gerrard
Regarding the original question: "how to make mysql's idle timeouts shorter so that I can debug my code?" You should be able to do that in the mysql shell: mysql> show variables like '%timeout%'; ++---+ | Variable_name | Value | +---

Re: [Twisted-Python] Incorrect "Another twistd server is running..."

2009-07-21 Thread Simone Deponti
On 07/21/2009 07:10 PM, Christopher Armstrong wrote: It's not necessarily a twistd process. It could be any process with the same pid. checkPID only checks to see if the pid exists, not that it's the PID of a twistd process. Disclaimer is, I might be extremely naive here. I have to admit I wasn

Re: [Twisted-Python] Incorrect "Another twistd server is running..."

2009-07-21 Thread Jean-Paul Calderone
On Wed, 22 Jul 2009 00:41:20 +0200, Simone Deponti wrote: >On 07/21/2009 07:10 PM, Christopher Armstrong wrote: >>It's not necessarily a twistd process. It could be any process with >>the same pid. checkPID only checks to see if the pid exists, not that >>it's the PID of a twistd process. > >Disc

Re: [Twisted-Python] OT - adbapi, connection timeouts, mysql - OT

2009-07-21 Thread Garret Heaton
Instead of trying to keep the connection alive you can also just reconnect when necessary. Example code here: http://stackoverflow.com/questions/207981/how-to-enable-mysql-client-auto-re-connect-with-mysqldb/982873#982873 On Tue, Jul 21, 2009 at 2:18 PM, Clay Gerrard wrote: > Regarding the origin

Re: [Twisted-Python] OT - adbapi, connection timeouts, mysql - OT

2009-07-21 Thread Gabriel Rossetti
Hello Werner, Thanks for your idea, I will give it a try if my current "fix" doesn't work well (reconnecting if I get a connection lost exception and re-running the query). Gabriel Werner Thie wrote: > Hi Gabriel > > had the same problem, solved it by having keepalive() called in a > LoopingC

Re: [Twisted-Python] OT - adbapi, connection timeouts, mysql - OT

2009-07-21 Thread Gabriel Rossetti
Hello Clay, thanks! It will help me debug my code by setting a low timout. Gabriel Clay Gerrard wrote: > Regarding the original question: > "how to make mysql's idle timeouts shorter so that I can debug my code?" > > You should be able to do that in the mysql shell: > mysql> show variables like

Re: [Twisted-Python] OT - adbapi, connection timeouts, mysql - OT

2009-07-21 Thread Gabriel Rossetti
Hello Garret, yes, I finally did did something like that, I am currently testing the code. Thanks, Gabriel Garret Heaton wrote: > Instead of trying to keep the connection alive you can also just > reconnect when necessary. Example code here: > http://stackoverflow.com/questions/207981/how-to-e