Created by vinchen and last modified
Get this branch:
bzr branch lp:~vinchen13/mysql-proxy/fix_some_bugs
Only vinchen can upload to this branch. If you are vinchen please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

MySQL Proxy

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

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"

2. By vinchen

fix bug for NULL pointer exeception

1. By vinchen

origin source code from mysql-proxy-0.8.2

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
This branch contains Public information 
Everyone can see this information.