-
Task
-
Resolution: Won't Do
-
Major
-
None
-
None
-
None
-
We have raised an Epic with SD to add a proper SQL proxy to quay.io - https://issues.redhat.com/browse/SDE-794
One suggestion raised was to consider adding a check statement to connections to ensure the database is in good shape before trying to connect- something like (pseudo-python):
from playhouse.pool import PooledMySQLDatabase
class CheckedPooledMySQLDatabase(PooledMySQLDatabase):
def connect(self, reuse_if_open):
connection = super(PooledMySQLDatabase, self).connect(reuse_if_open)
try:
if connection.execute("SELECT 1"):
return connection
else:
connection.manual_close()
return None
except e:
pass
return None
Task is to try this out & see if it possibly prevents connections from blocking.
http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#PooledMySQLDatabase