Hi to all,
while trying to solve a leak with dynamic class loading I found out
that mysql connector creates an AbandonedConnectionCleanupThread that
is retained in the ChildFirstClassLoader..from version 8.0.22 there's
the possibility to inhibit this thread passing the system property
com.mysql.disableAbandonedConnectionCleanup=true [1] (I put the mysql
jar in the lib folder).

I tried to set in the flink-conf.yml
env.java.opts: "-Dcom.mysql.disableAbandonedConnectionCleanup=true"

but the property does not produce the desired effect in the static
section of such a thread [2] (I verified that attaching the remote
debugger to the task manager).

How can I fix this problem?

[1] https://dev.mysql.com/doc/relnotes/connector-j/8.0/en/news-8-0-22.html
[2]
public class AbandonedConnectionCleanupThread implements Runnable {
    private static boolean abandonedConnectionCleanupDisabled =
Boolean.getBoolean(PropertyDefinitions.SYSP_disableAbandonedConnectionCleanup);

    static {
        if (abandonedConnectionCleanupDisabled) {
            cleanupThreadExecutorService = null;
        } else {
            cleanupThreadExecutorService =
               Executors.newSingleThreadExecutor(r -> {....}
       }
  }

Reply via email to