You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
note the last fd numbers (742, 752, 753, 762, 778) are the same.
I guess there is a remaining refcount to the underlying os socket.
Should asyncmy call transport.shutdown() before transport.close() in Connection.close() ?
The text was updated successfully, but these errors were encountered:
transport does not have the method shutdown. The problem here is probably you close event loop without cleanup.
Underneath, transport.close() closes the underlying socket in the next event loop tick. See code, so you need to wait the rest to finish before closing the event loop.
You can try add a await asyncio.sleep(0) after calling conn.close() to see if it fixes the issue.
I am having fd leaks in mysql connections.
From the runtime inspection of GC, all Python objects are properly garbage-collected. However the actual TCP connections are still alive.
objgraphql.by_type('socket.socket')
only lists the 6 connections:but
ss
orlsof
shows many more connections including the old connections:note the last fd numbers (742, 752, 753, 762, 778) are the same.
I guess there is a remaining refcount to the underlying os socket.
Should asyncmy call
transport.shutdown()
beforetransport.close()
inConnection.close()
?The text was updated successfully, but these errors were encountered: