New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non psycopg2 exception can lock connection #79

nxsofsys opened this Issue Nov 15, 2014 · 1 comment


None yet
2 participants

nxsofsys commented Nov 15, 2014

For example I have code like this and only one connection in pool:

            cursor = yield momoko.Op(self.db.execute, 'SELECT %s FROM %s'
                ,()) # rises TypeError
        except Exception as e:
            print e
            cursor = yield momoko.Op(self.db.execute, 'SELECT 1'
            print 'Done' #unreachable

This code rises TypeError, but second query can't obtain connection.
Debug log is:

[D 141115 18:00:26 connection:234] Connection attempt complete. Success: True
[D 141115 18:00:31 connection:252] Getting connection
[D 141115 18:00:31 connection:327] Connection obtained, proceeding
tuple index out of range
[D 141115 18:00:31 connection:252] Getting connection
[D 141115 18:00:31 connection:272] There are busy connections
[D 141115 18:00:31 connection:321] No connection available right now - will try again later

Changing psycopg2.Error to Exception in _catch_early_errors decorator fixes that issue, but I not sure that it right.

@haizaar haizaar closed this in b15c2c2 Nov 16, 2014

haizaar added a commit that referenced this issue Nov 16, 2014

Merge pull request #80 from haizaar/master
Catching ALL types of early error. Fixes #79.

This comment has been minimized.


haizaar commented Nov 16, 2014

Thanks for the bug report and suggestion for the fix!

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