asyncmy
asyncmy copied to clipboard
Connection pool can not close its connections properly
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.
It seems that this issue also exists in aiomysql (https://github.com/aio-libs/aiomysql/pull/987), and haven't been fixed yet.