Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
fix for any uncatchable internal exceptions #134
There is the problem, when momoko fails with exception, such as, for example, IndexError for parameters, which is not catchable by Tornado. In the result of this behavior - this connection stays busy and inoperable. So, this little patch would catch these exceptions and throw them to Tornado
Ok, then, RuCTFE 2015 is over and I can show you piece of code, which fails here. (except unittest, published earlier).
when variable 'offset' is sended by another python code, where it looks like
offset = "0; SELECT * FROM users WHERE username LIKE '%%='"
So, when this input received - this thread of momoko.Pool throws uncatchable exception and doesn't close till application restart.
I think I see what you are saying -
Can you try my master branch haizaar/momoko@7dcc245? I've fixed it there.
My environment shows a lot of failed tests, so I can't recognize is problem still exists, or it is gone((
The main test, which failed for me is:
search = "WHERE name LIKE '%%searchable' LIMIT %s" % 10
Is it still fails, or your fix repaired it? I see, your test is about some different case, which was catchable for me earlier.