Close Inactive Connections to Internal Metabase DB

Hey Metabase Folks,

We are running Metabase on AWS and using AWS Aurora Server-less MySQL as the internal persistence layer for Metabase. Aurora has the ability to shut down automatically after X minutes when all DB connections have been terminated. So I have been trying to find a way to make this happen to no avail.

As far as I understand Metabase uses C3P0 as the connection pooling library underneath the hood. I have tried passing parameters to be interpreted by this library via a couple of ways:

  • By making use of the JDBC option and passing C3P0 parameters that way
  • By using system level definitions to pass in C3P0 parameters.

Unfortunately both methods have failed so far. What I’m curious to know is if this is possible; and if so do you know how to do it?

Created https://github.com/metabase/metabase/pull/9788 to resolve the C3P0 issues. Still not sure what else may be causing queries (a heartbeat mechanism?). Any help would be appreciated.