← Back to team overview

mysql-proxy-discuss team mailing list archive

Re: funnel - a multiplexer plugin for mysql-proxy

 

nick loeve wrote:
> Hi again,
[...]
> Ok, well i found my issue finally. If I do not add the event when
> placing a backend connection back in the connection pool, then i get
> no crash :)

Did you use event_add() or chassis_event_add_local() ? As you run
against the 0.8 tree, that's the way network-conn-pool.c handles it.
chassis_event_add_local() is taking the event_base from the TLS compared
to chassis_event_add() which is handling it asynchronously (and may move
the connection to another thread).

> I have to work out a better way of detecting a wait_timeout etc on the
> backend, as the event_del we do when pulling a connection from the
> pool must fiddle with the event_base, which could belong to another
> thread.
> 
> Previous to discovering this, I added the trylock/lock to
> network_mysqld_con_handle, and I did see multiple threads trying to
> run the same connection's state machine, although in practice (at
> least in my circumstance) this should not be an issue as we return
> from network_mysqld_con_handle immediately after either adding the
> connection to the backlog or a WAIT_FOR_EVENT.
> 
> I also made the backlog thread-local, although this didn't help, and I
> really want a global backlog.
> 
> But thanks again, you reminded me to give helgrind a go, which
> although pretty flaky, managed to point me in the right direction.
> 
> Cheers, ill have an update of where i am at soon
> 


cheers,
  Jan
-- 
 jan: "Gee, Brain^WEric, what'd you wanna do tonight?"
eric: Same thing we do everynight: Take over the HelloWorld!



Follow ups

References