Hello we have noticed that after around 2 weeks in our usecase, we lost Keycloak connection to database. Keycloak not crash itself. It is just not have DB resources. So each operation end finally with exception as it is not possible to read or write to DB.
We have observed in logs:
Error retrieving channel from pool
Datasource '<default>': JDBC resources leaked: 6 ResultSet(s) and 6 Statement(s)
Every day we have observed 1-2 this logs Datasource '<default>': JDBC resources leaked: 6 ResultSet(s) and 6 Statement(s)
but before crashed it is about 8000 logs like this.
Restart of Keycloak fix issue for another 2 weeks more or less
We have 3 Keycloak instances with default DB settings. Version 21.0.2
Do you have any ideas how to investigate and fix this topic. I have only found that it could be connected with not closing Streams during querying DBs, but I haven’t spotted this in source code.