We have a fairly simple Java SE standalone application that works as a scheduler. Each time it fires a new schedule a new Thread is created within which a new JDBC Connection is obtained from DriverManager.getConnection().
This has been running fine for many years. Then USN-2124-1 arrived and now, apparently at random, those Connections are hanging around for hundreds of seconds quickly exhausting the maximum number of MySQL connections allowed.
During one of these "incidents", I grabbed a thread dump via jstack which shows two of our schedule threads plus a very small number of threads that appear to be jvm housekeeping. So our own threads appear to have been garbage collected as expected.
If I also grabbed lsof output for the java process, and I see dozens of connections to MySQL. I am at a loss to explain how.
Can anyone offer suggestions?
Note: We also switched a test server across to MariaDB and observed the same sudden behaviour after a while.