lp:~vinchen13/mysql-proxy/fix_some_bugs
- Get this branch:
- bzr branch lp:~vinchen13/mysql-proxy/fix_some_bugs
Branch merges
Branch information
Recent revisions
- 5. By vinchen
-
fix the stuck problem when the clients' concurrency too much
While doing stress testing, 5000 connections execute a short query through proxy constantly,the proxy would have no response after a while. If strace the proxy process, and all the event threads are always logged like this :
sendto(4, ".", 1, 0, NULL, 0 <unfinished ...>The problem come from the function chassis_event_add, and there are too much event when the clients' concurrency too much.
Now I modified the implement of chassis_event_add by using random num to determin the handle thread's event_base. Moreover, the event base of libevent must be thread-safe.
So the proxy should depend on libevent which version no less than 2.0(event base is thread safe https://raw.github. com/libevent/ libevent/ patches- 2.0/whatsnew- 2.0.txt). The problem is critical, and see also in
http://bugs.mysql. com/bug. php?id= 63908&error= no
http://forums. mysql.com/ read.php? 146,433299, 433299# msg-433299 - 4. By vinchen
-
fix the potential concurrent problems in chassis_
private- >cons chassis_
private- >cons is a GPtrArray, and it's not thread-safe. But all the event thread can add or remove connections at one time. So it should have some concurrent protection while adding or removing connections. So, add one mutex to protect chassis_ private- >cons.
By the way, maybe add a connection would not have the concurrent problems, because only the main thread can do it. For security, all the global variable shoule be protected when visiting. - 3. By vinchen
-
fixed up the bug of decoding the string of Protocol 4.0
In protocol 4.0, a string at the end of the packet is not null terminated. But proxy use interface "network_
mysqld_ proto_get_ gstring" to decode all null-terminated string. In fact, some tail string in packet may considered to be error(e.g. "network_ mysqld_ proto_get_ auth_response" ), leading to wrong error message.
For example, 4.0 client connect the proxy, can not get the error message "4.0 protocol is not supported"
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)
- Stacked on:
- lp:mysql-proxy