79074337

Date: 2024-10-10 12:14:37
Score: 0.5
Natty:
Report link

The thread for cleaning abandoned connections is created in the JVM as static, so the GC can't do anything with it, which ultimately blocked unloading classes. In driver version 8.x, you can disable the creation of this thread by adding to the JVM parameter

-Dcom.mysql.cj.disableAbandonedConnectionCleanup=true

In Flink you can add this to config.yaml file like this:

env:
   java:
      opts:
         all: -Dcom.mysql.cj.disableAbandonedConnectionCleanup=true

In older versions of the driver, there is no such option and the only thing you can do is to disable this thread manually at the application startup by executing com.mysql.jdbc.AbandonedConnectionCleanupThread.shutdown();

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: MichaƂ Szostek