asyncmy icon indicating copy to clipboard operation
asyncmy copied to clipboard

Connection pool can not close its connections properly

Open Cycloctane opened this issue 11 months ago • 1 comments

asyncmy cannot close connections properly when pool is closed or connections in pool timed out. Example for connection pool in readme causes error messages on mysql server:

[Note] [MY-010914] [Server] Aborted connection ... to db ... (Got an error reading communication packets)

Traffic analysis indicates that there are no COM_QUIT packets sent when closing connections in connection pool. It seems that this is because connection pool uses conn.close() to close connections in pool, which simply remove the socket without sending COM_QUIT packets to server. Change it to conn.ensure_closed() will solve the problem.

Cycloctane avatar Dec 06 '24 21:12 Cycloctane

It seems that this issue also exists in aiomysql (https://github.com/aio-libs/aiomysql/pull/987), and haven't been fixed yet.

Cycloctane avatar Dec 11 '24 06:12 Cycloctane