Bug #29472 mysql-proxy exits with no active/shutdown server
Submitted: 1 Jul 2007 23:51 Modified: 12 Jul 2007 12:48
Reporter: Adam Dixon Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Proxy: Core Severity:S3 (Non-critical)
Version:0.5.0 OS:Linux (Fedora)
Assigned to: Jan Kneschke CPU Architecture:Any
Tags: mysql-proxy, proxy

[1 Jul 2007 23:51] Adam Dixon
Description:
If a mysqld is not available the mysql-proxy aborts. Should it not stay up regardless hoping for a return of a mysqld.

How to repeat:
Start proxy with out mysqld running, or, have mysqld running, the mysqladmin shutdown it. 
./mysql-proxy

Then;
mysql -u root -h localhost -P 4040 --protocol=tcp
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0

(output from ./mysql-proxy)
network-mysqld.c.325: connect(127.0.0.1:3306) failed: Connection refused
network-mysqld-proxy.c.2312: connecting to backend (127.0.0.1:3306) failed, marking it as down for ...
network-mysqld-proxy.c.2303: all the backends are down
network-mysqld.c.830: plugin_call(CON_STATE_CONNECT_SERVER) returned an error
Aborted

# strace -s 128 -tt -o strace.txt mysql-proxy
strace: mysql-proxy: command not found
[root@dixon sbin]# strace -s 128 -tt -o strace.txt ./mysql-proxy
[ Process PID=10438 runs in 32 bit mode. ]
network-mysqld.c.325: connect(127.0.0.1:3306) failed: Connection refused
network-mysqld-proxy.c.2312: connecting to backend (127.0.0.1:3306) failed, marking it as down for ...
network-mysqld-proxy.c.2303: all the backends are down
network-mysqld.c.830: plugin_call(CON_STATE_CONNECT_SERVER) returned an error

Suggested fix:
Provide a returned error, and wait until mysqld's return?
[1 Jul 2007 23:52] Adam Dixon
strace of exit

Attachment: strace.txt (text/plain), 8.12 KiB.

[2 Jul 2007 0:06] Adam Dixon
Also occurs in 0.5.1
[2 Jul 2007 6:52] Sveta Smirnova
Thank you for the report.

Verified as described.
[3 Jul 2007 7:11] Jan Kneschke
In revision 56 the assertion got removed, in a second patch we will return a nice error-msg on the protocol level.
[12 Jul 2007 12:45] Jan Kneschke
We return 

  #00S00(proxy) all backends are down

now on the protocol level.

Fixed in [91].
[12 Jul 2007 12:48] Jan Kneschke
Thanks, Valeriy. It is really closed :)