Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-20614

Registered sql drivers not deregistered after task finished in session cluster

    XMLWordPrintableJSON

Details

    Description

      DriverManager keeps registered drivers in its internal data structures which prevents they from gc after task finished. I confirm it in standalone session cluster by observing that ChildFirstClassLoader could not be reclaimed after several GC.run, it should exist in all session clusters.

      Tomcat documents this and fixes/circumvents this with JdbcLeakPrevention.

      Should we solve this in runtime ? Or treat it as connector and clients' responsibility to solve it using RuntimeContext.registerUserCodeClassLoaderReleaseHookIfAbsent or similar ?

      Personally, it would be nice to solve in runtime as a catch-all to avoid memory-leaking and provide consistent behavior to clients cross per-job and session mode.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kezhuw Kezhu Wang
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: