Hi,
We are running Datahub v10.5 but this problem has been bothering us since we first started to use the product.
We have a backend MySQL DB for metadata and we see that is intermittently gets locked out due to the below error -
Caused by: java.sql.SQLException: null, message from server: "Host 'XX.XX.XX.XX' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'"
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:836)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:197)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:189)
at io.ebean.datasource.pool.ConnectionPool.createUnpooledConnection(ConnectionPool.java:529)
at io.ebean.datasource.pool.ConnectionPool.createUnpooledConnection(ConnectionPool.java:524)
at io.ebean.datasource.pool.ConnectionPool.createConnectionForQueue(ConnectionPool.java:766)
at io.ebean.datasource.pool.PooledConnectionQueue._getPooledConnection(PooledConnectionQueue.java:314)
at io.ebean.datasource.pool.PooledConnectionQueue.getPooledConnection(PooledConnectionQueue.java:270)
at io.ebean.datasource.pool.ConnectionPool.getPooledConnection(ConnectionPool.java:817)
at io.ebean.datasource.pool.ConnectionPool.getConnection(ConnectionPool.java:805)
at io.ebeaninternal.server.transaction.TransactionFactoryBasic.createQueryTransaction(TransactionFactoryBasic.java:28)
We have set the EBEAN_MAX_CONNECTIONS to 200 and below are our relevant Mysql settings:
max_user_connections: 200
max_connections_per_hour: 200 (400 in lower environments)
We observed that just 1 click on the Datahub UI creates multiple sleeping DB connections for the application user. We are not sure how the metadata DB connections are being handled in the code and we fear that any open connections are not being closed in the backend code, resulting in such sleeping connections. This has become a very frequent problem and when we onboard more end users we see more frequent occurences of this issue.
Right now the workaround is we manually login to the DB and kill the sleeping connections. We want to find the root cause as to why there are always so many open sleeping connections after any ingestion or any user activity on the UI.
Is anyone else facing the same issue with their backend DB ?