Closed dla-c-box closed 2 years ago
Did it actually solved the problem? I think it might have yet some other issue regarding connection cleanup. I will further review the code for connection management issues. Thank you.
Yes, it did solve this specific issue. I was able to confirm the exact number of connections that were added on each re-deploy without the fix, and to confirm that it (the number of connections increasing) was no longer the case with the fix. This doesn't mean there aren't other connection cleanup problems to be found, but it fixed this specific one. Thanks.
Every time the plugin is re-deployed, it is leaking the previous DB connections, up to the point where it depletes the available DB connections (especially in a Development mode with a limited number of DB Connections available, but the same would be true for Production), and the DB log would show something like this:
And Keycloak would show the error "We are sorry... An internal server error has occurred":
e.g. Checking the number of connections on a Postgresql DB, running
SELECT sum(numbackends) FROM pg_stat_database;
would show that 10 connections are leaked on each re-deploy.