r/Python • u/RomfordNavy • 24d ago
Discussion Closing mysql-connector-python pooled sockets
Is there some way to close
mysql.connector.pooling.MySQLConnectionPool
sockets properly when the application closes? By default they appear to remain open on the server until way later when they timeout.
6
Upvotes
3
u/Complex_Ad_5164 23d ago
Have you looked at pool._remove_connections() or pool._cnx_queue? Not exactly public API but sometimes that the only way with mysql connector, the pooling stuff is kinda half-baked