[Twisted-Python] Twisted server connection loss with Mysql

James Y Knight foom at fuhm.net
Thu Jun 2 14:20:27 EDT 2005

On Jun 2, 2005, at 8:47 AM, Raghul Jagan wrote:
>          I also tried using the "cp_reconnect=1" for my twisted  
> server.The first time it works but  the same error ocurrs after  
> that .Is there anyway to solve this problem? I also tried by  
> changing the value "reconnect=True" in adbapi.py file,the same  
> error occurs what will be my problem? My machine configuration is

The expected behavior of cp_reconnect is not to retry the query  
automatically if it fails, because doing so could have undefined  
consequences. Really, it probably could retry when the error was on  
the query, not on the commit, but it doesn't currently.

If you have a connection pool size of 10, expect to see 10 queries  
fail before everything's working perfectly again, as each thread  
notices its connection has died (after failing to make the query) and  
closes it. In your app, you can either catch ConnectionLost errors  
and retry the queries yourself or live with 10 queries failing after  
restarting the database.


More information about the Twisted-Python mailing list