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

Registered sql drivers not deregistered after task finished in session cluster

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            kezhuw Kezhu Wang

            Dates

              Created:
              Updated:

              Slack

                Issue deployment