Skip to content
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

Handle ClientConnectorError in connector #44

Closed
dimaqq opened this issue Apr 15, 2020 · 6 comments · Fixed by #113
Closed

Handle ClientConnectorError in connector #44

dimaqq opened this issue Apr 15, 2020 · 6 comments · Fixed by #113

Comments

@dimaqq
Copy link
Contributor

dimaqq commented Apr 15, 2020

Exception text: ClientConnectorError: Cannot connect to host dynamodb.<snip>.amazonaws.com:443 ssl:default [None]

Exception type: aiohttp.client_exceptions.ClientConnectorError

Stack:

aiohttp/connector.py in _wrap_create_connection at line 943
aiohttp/connector.py in _create_direct_connection at line 980
aiohttp/connector.py in _create_direct_connection at line 1004
aiohttp/connector.py in _create_connection at line 858
aiohttp/connector.py in connect at line 523
aiohttp/client.py in _request at line 480
aiohttp/client.py in __aenter__ at line 1012
aiodynamo/http/aiohttp.py in post at line 31
aiodynamo/client.py in send_request at line 651
aiodynamo/client.py in get_item at line 454
aiodynamo/client.py in get_item at line 124
@dimaqq dimaqq changed the title Handle aiohttp.client_exceptions.ClientConnectorError in connector Handle ClientConnectorError in connector Apr 15, 2020
@dimaqq
Copy link
Contributor Author

dimaqq commented Apr 15, 2020

There are probably other exceptions of this kind that could be bundled together...

@ojii
Copy link
Contributor

ojii commented Apr 15, 2020

weird, ClientConnectorError is a subclass of ClientError which we catch.

@dimaqq
Copy link
Contributor Author

dimaqq commented Apr 15, 2020

The cause (?, I'm not sure which way exception stack grows):

ConnectionAbortedError SSL handshake is taking longer than 60.0 seconds: aborting the connection

(that's a Python built-in exception)

@dimaqq
Copy link
Contributor Author

dimaqq commented Apr 15, 2020

Weirdly wrap_errors is not shown in the backtrace...
I wonder if that's merely an artefact of how the decorator is applied, or something deeper?

@dimaqq
Copy link
Contributor Author

dimaqq commented Apr 15, 2020

weird, ClientConnectorError is a subclass of ClientError which we catch.

Indeed it's odd, if I try it manually, I get:

ClientConnectorError: Cannot connect to host nowhere.com:443 ssl:default [Connect call failed ('89.31.143.1', 443)]

During handling of the above exception, another exception occurred:

RequestFailed                             Traceback (most recent call last)
<ipython-input-11-464539fe8630> in <module>
----> 1 await ai.get(url="https://nowhere.com",timeout=None)

~/aiodynamo/src/aiodynamo/http/aiohttp.py in wrapper(*args, **kwargs)
     18             return await coro(*args, **kwargs)
     19         except (ClientError, asyncio.TimeoutError):
---> 20             raise RequestFailed()
     21
     22     return wrapper

RequestFailed:

@dimaqq
Copy link
Contributor Author

dimaqq commented Apr 16, 2020

I think we're still running 20.4 and wrap_errors was added in 20.4.1 😅

@ojii ojii mentioned this issue Jan 15, 2022
@ojii ojii closed this as completed in #113 Feb 3, 2022
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 a pull request may close this issue.

2 participants