← Back to team overview

mysql-proxy-discuss team mailing list archive

Re: [MySQL Proxy] Connection Close and ERROR 2013

 

On Thu, Jun 11, 2009 at 12:04 PM, Kay Röpke<Kay.Roepke@xxxxxxx> wrote:
> Hi!
>

First, thank you to answer me (and how fast !! :) )

>>
>> I got a little problem with mysql-proxy.
>> Basically, when I try to create several connections via my
>> mysql-proxy, I have no problem until the connection where I have the
>> following error :
>> $ mysql -ulabynocle -p --host=127.0.0.1 --port=3318
>> Enter password:
>> ERROR 2013 (HY000): Lost connection to MySQL server at 'reading final
>> connect information', system error: 0
>>
>> When I check the mysql-proxy log, I have the following line :
>> 2009-06-11 09:52:27: (debug) [network-mysqld.c:784]: error on a
>> connection (fd: -1 event: 0). closing client connection.
>
> I guess we need to work on that error message to output more information.
> Unfortunately this isn't telling us much, apart from what we already know:
> The server closed the connection. :|
>
>> Then I try another new connection and I have no problem.
>> But the problem comes back then ! I guess when I have the bug, a
>> connection is closed then I can create a new one. This is why I
>> believe it works when I retry...
>> Besides I have no error in my /var/log/message.
>
> Just to clarify, MySQL Proxy won't log anything to /var/log/message if it
> writes its own log file. Neither will mysqld.
> Proxy can use use syslog (--log-use-syslog), however I wouldn't recommend it
> because the noise in /var/log/messages usually makes it hard to see what's
> going on, unless you direct it to its own file, but then what's the point of
> using syslog :)
>

Thank you for this precision, I also prefer to use a dedicated log !

>> My configuration :
>> mysql-proxy v 0.7.1 (from
>>
>> http://code.launchpad.net/mysql-proxy/0.7/0.7.1/+download/mysql-proxy-0.7.1.tar.gz)
>> compiled with no particular option
>> rw-splitting.lua script has been patched thanks to the following patch
>> :
>> https://code.launchpad.net/~diego-fmpwizard/mysql-proxy/bug-43424/+merge/4259
>
> Ok, makes sense.
> Have you tried this with a binary from
> http://dev.mysql.com/downloads/mysql-proxy? Shouldn't make a difference, but
> it's worth a try.
>

Nop I didn't try with this binary. I will do some tests with it (just
to be sure)
I have a question about the patch from Diego : why is still in "Needs
review" status ? I understand the different changes but I'm not enough
confident with the rw-splitting.lua script to understand some
commented lines (lines 63 and 79 of the patch)... If you have any clue
about it, I'm really interested ! :)

> However, what I think is going on might be related to this bug report:
> http://bugs.mysql.com/bug.php?id=28359
> The gist is that this error can be caused by exceeding the connect_timeout
> (the default is rather small) which causes the server to just close the
> connection leading to error 2013 on the client.

Actually I have no problem when I didn't use the proxy :( .

> What is it set to in your mysqlds? Which versions are you running? (mmmh I
> think we should log the server versions we connect to, I'll file a feature
> request.)
>

Oops ! I forgot to mention that ! I use a mysqld 5.0.77

> Are your backend servers rather busy? If so that might lead to what's
> described in the bug report mentioned above. If not, it might be a problem
> with how we assemble the handshake packet, or a more general problem with
> the connection pool, but all of that is pure speculation at this point.
>
> How often does this occur? If it's quite frequent, could you get a trace for
> that connection using wireshark so we can see what the actual packets are?
> (Again, maybe it's worthwhile for us to include an option to dump the
> traffic for each connection to a file - that could greatly help with
> debugging!)

It often occurs when I got the first error.
I'm probably wrong but I think at the beginning there is no connection
in the pool... so I have no problem to create new one... Then I got
the first error and when I try one more time, I have no problem. But
next try I get the error and next it's ok ! And so on...
So with my tiny knowledge of this subject I presume I have a problem
with the connection pool :(

I'll will reproduce it as soon as possible with the different traces
you ask me !


>> How I run mysql-proxy :
>> export LUA_PATH="/usr/local/mysql-proxy-0.7.1/lib/mysql-proxy/lua/?.lua"
>> /usr/local/mysql-proxy-0.7.1/sbin/mysql-proxy --proxy-address=:3318
>>
>> --proxy-lua-script=/usr/local/mysql-proxy-0.7.1/lib/mysql-proxy/lua/rw-splitting.lua
>> --proxy-backend-addresses=10.0.0.42:3306
>> --proxy-read-only-backend-addresses=127.0.0.1:3308
>> --admin-address=127.0.0.1:4041 --log-file=/var/log/mysql-proxy.log
>> --log-level=debug --max-open-files=1024
>> --pid-file=/var/run/mysql-proxy.pid >> $LUALOG &
>
> I'm assuming you are aware of the problems rw-splitting.lua has. If not, or
> if you've encountered any shortcomings/bugs/problems with it that aren't
> already known, please refer to
> http://forge.mysql.org/wiki/MySQL_Proxy_RW_Splitting. Feel free to edit that
> page, too. That will help us and others to hopefully improve it going
> forward.
>

I already read this wiki page. But still good to remember these kind
of references in this thread :)
I'll do all my best to improve mysql-proxy... I really believe in this stuff !

>> I have no clue so any will be greatly appreciated :)
>> If you need more info/log or something else let me know.
>> And please forgive my poor english level :)
>
> Why? It's fine! :)
>

hehe thank you, but I know I have to quickly improve it ;)

> Thank you for your report!
>
> cheers,
> -k
> --
> Kay Roepke
> Software Engineer, MySQL Enterprise Tools
>
> Sun Microsystems GmbH    Sonnenallee 1, DE-85551 Kirchheim-Heimstetten
> Geschaeftsfuehrer:    Thomas Schroeder,  Wolfang Engels,  Wolf Frenkel
> Vorsitz d. Aufs.rat.: Martin Haering                    HRB MUC 161028
>
>

Erwan



Follow ups

References