-
Couldn't load subscription status.
- Fork 1.1k
Open
Description
Reading the official aiohttp documentation: https://docs.aiohttp.org/en/stable/client_reference.html
I optimized my code to have a single ClientSession within my app to take advantage of connection pooling
class My_class:
_clientSession= aiohttp.ClientSession()
async def my_method():
async with self._clientSession.ws_connect(uri) as ws:
await ws.receive_json()
...
await ws.send_json(stuff)my_method is invoked twice - to different web sockets, over TLS simultaneously.
I get randomly served with a Uncaught exception in callback: (-28928, 'MBEDTLS_ERR_SSL_BAD_INPUT_DATA').
Creating the ClientSession within my_method completely resolves the issue - but at the expense of connection pooling. I strongly suspect a racing condition tied to the pooling.
This is happening on a pico 2 w running 1.25.0
Metadata
Metadata
Assignees
Labels
No labels