-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
_RequestContextManager will not close connection if ClientConnectorError has happened #2189
Comments
I think I recently hit the same issue and believe I found the root cause, which resides in the BaseConnector class (in connect.py) Below is the way I currently understand the issue: The first connection passes the limit, and goes into the _create_connection method However if the previous _create_connection raises, no connection object gets created. The self._acquired gets cleaned up correctly in this case, but noone notifies that a new connection is now available, and so the waiter never gets freed. This has the observable outcome that a waiter will always be stuck waiting, and that your connection pool size is effectively reduced by one. Hopefully this is helpful in fixing the bug. |
@matthiasblondeel great explanation! Do you have any ideas how to fix that? |
I will look into this problem during this weekend |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs. |
Long story short
When using _RequestContextManager and try to get a host which can not be connected to, connection will not be released to the pool.
Expected behaviour
Raises an Exception and connection releases.
Actual behaviour
Raises an Exception.
Steps to reproduce
Your environment
macOS 10.12.6
Python 3.6.1
aiohttp 2.2.5
The text was updated successfully, but these errors were encountered: