EM::Client previous result still active on connection, retry later logic #138

wants to merge 1 commit into


None yet
3 participants

pkqk commented Mar 30, 2011


We've recently discovered a problem requesting multiple quick selects via EventMachine, it seems we're not getting the result from mysql before sending the next query. This might be better solved by a connection pool like in #132
But we've currently solved it here by putting the query back onto the event queue. No tests yet sorry since we're having trouble creating the failure other than in production where the server is faster than the database (amazon EC2 and RDS)

I'd like to know what you think is the best approach?



brianmario commented Mar 30, 2011

A connection pool is really the best way to handle this IMO.
But I do like that you added another exception type for the case when a connection is waiting on a result. If you could (temporarily?) revert the changes to the em driver, and update the existing test to use the new exception type I'll pull the rest in.

I'd like to get that connection pool implementation pulled in as well but won't have time for another couple of weeks probably cause of CodeConf and stuff.

tomlea commented Mar 30, 2011

Incase it matters, I've written a test for @pkqk's solution. Without the patch it fails consistently for me.


pkqk commented Mar 30, 2011

I've reverted and unreverted that part of the change, so you can merge in https://github.com/reevoo/mysql2/commit/fe1a5941104b66f88219c59940b0f8ff4b3d5832
if you want just the exception class changes


brianmario commented Mar 30, 2011

Awesome thanks! I'll try and pull it in later today, crazy day at work :\

pkqk commented Apr 5, 2011

I updated the change by pulling in one of thegdb's commit (83266de) which was a better way of handling it.

here a3ab603


brianmario commented May 7, 2013

Sorry it's taken so long to reply - Closing this for now. See my comment here for context.

brianmario closed this May 7, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment