8000 Fixed counter on failed connection by qweryty · Pull Request #283 · encode/databases · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fixed counter on failed connection #283

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

Closed
wants to merge 3 commits into from

Conversation

qweryty
Copy link
Contributor
@qweryty qweryty commented Jan 29, 2021

Sometimes self._connection.acquire() can throw an exception and self._connection_counter will remain 1, in that case, if we try to reconnect __aenter__ will always skip self._connection.acquire() and we won't be able to make any further requests to database.

@taybin
Copy link
Contributor
taybin commented Sep 8, 2021

I believe I have been encountering this issue, so it would be great to see this or something similar to it merged.

@taybin
Copy link
Contributor
taybin commented Sep 9, 2021

Looks like it just needs a unittest.

Copy link
Member
@aminalaee aminalaee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this can be simplified a bit?

@aminalaee
Copy link
Member

I'll try to add the test for new code, @taybin feel free to add that if you like.

@taybin
Copy link
Contributor
taybin commented Sep 9, 2021

I'm working on a unittest for this right now.

@taybin
Copy link
Contributor
taybin commented Sep 9, 2021

@aminalaee I have a PR with @qweryty's code and a unittest at #385

@aminalaee aminalaee closed this Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0