Bug #31512 mysql-proxy hangs when one of the underlying mysqld is stopped
Submitted: 10 Oct 2007 18:09 Modified: 12 Mar 2008 11:20
Reporter: Maxim Volkov Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Proxy: Core Severity:S1 (Critical)
Version:0.6.0 OS:Linux (Suse 10.1)
Assigned to: Assigned Account CPU Architecture:Any

[10 Oct 2007 18:09] Maxim Volkov
Description:
mysql-proxy was up for over two weeks when maintenance on one of the mysql servers had to be performed. Proxy was load balancing among six servers. Once the mysqld was down the mysql-proxy echoed a few dozen times the following error :

mysql> network-mysqld.c.564: write() failed: Connection timed out
network-mysqld.c.1278: network_mysqld_write(CON_STATE_SEND_QUERY_RESULT) returned an error

mysql-proxy became unresponsive for a good while and eventually had to be killed with -9. 

How to repeat:
Run mysql-proxy against few mysql servers with load balancing lua script. 
Issue /etc/init.d/mysql stop on one of them.
[10 Oct 2007 20:33] Sveta Smirnova
Thank you for the report.

Please provide load-balancing lua script you use.
[11 Oct 2007 5:28] Maxim Volkov
Lua script we were using at the time when issue happen.

-- balancer.lua

function connect_server() 

        math.randomseed(math.random(0,2147483647)*os.time());
        local id = math.random(1, #proxy.backends)
        proxy.connection.backend_ndx = id

end
[12 Feb 2008 11:20] Sveta Smirnova
Thank you for the report.

I can not repeat described behavior. I just correct error:
network-mysqld-proxy.c.3612: connect(127.0.0.1:3350) failed: Connection refused

Please upgrade to current verison 0.6.1, try with it and say us result.
[13 Mar 2008 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[19 May 2008 9:34] Sveta Smirnova
Can be related with bug #34793