On Saturday 07 December 2013 12:20 AM, Michael Bayer wrote:
[...]
the hard part is producing a test case.   I noticed just now that
even if I take overflow_lock out entirely, all the current tests
pass, but this is because it’s not easy for tests to catch race
conditions like that.   To test the new change, it should be simpler,
inject a mock connection that will hang on one attempt and pass on
another, then ensure that the second attempt successfully connects
within the overflow range before the “hanging” one does (or errors
out).

I was thinking of writing a dummy listener to connect MySQL python/connector to for the test case. I see that the your test case using a dummy connector method is much simpler and elegant.


Also can you confirm the MySQL behavior here is such that only
arbitrary connection attempts are hanging?   That is, a subsequent
connection attempt succeeds while the previous one continues to hang
- otherwise I’m not sure how this patch improves the situation.

My observation is that subsequent connection attempts go alright. Although some of my application instances (3 out of 12) hung, other instances (9 lucky ones out of 12) continued to work. Legacy PHP code without connection pooling continued to work.

Due the nature of the listen() backlog, this problem, I assume, is not specific to MySQL. Information I used to fix the MySQL problem provides more information [1][2][3].

Links:

1) https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_back_log

2) http://www.mysqlperformanceblog.com/2012/01/06/mysql-high-number-connections-per-secon/

3) http://man7.org/linux/man-pages/man2/listen.2.html

Thank you,

--
Sunil

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to