Description
Hi! I'm using aiomysql 0.0.20. I experienced an issue on connection.ping()
command. I'm using a connection pool. Problem appears when connection is once successfully acquired and after some time network problem appears. Before every request to MySQL database i'm calling connection.ping(reconnect=True)
command. Connection believes that self._writer is not None
and self._reader is not None
so await self._read_ok_packet()
is called on line 453. And there happens this:
try:
packet_header = await self._read_bytes(4)
except asyncio.CancelledError:
self._close_on_cancel()
raise
on line 560 in connection.py
.
self._read_bytes(4)
hangs forever until future is cancelled. In my case, future can be cancelled only if client cancels request to my aiohttp web server. Maybe there should be internal timeouts on this operation like asyncio.wait_for
?
P.S. I tried to wrap connection.ping(reconnect=True)
with asyncio.wait_for()
with my own timeouts, but this leads to the same error as #438 on the next time i'm trying to call connection.ping(reconnect=True)
.
Activity