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?
[+GB] Retry if connection is still waiting
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.
Incase it matters, I've written a test for @pkqk's solution. Without the patch it fails consistently for me.
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
Awesome thanks! I'll try and pull it in later today, crazy day at work :\
I updated the change by pulling in one of thegdb's commit (83266de) which was a better way of handling it.
Sorry it's taken so long to reply - Closing this for now. See my comment here for context.