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

PackagedProgram does not close URLClassLoader

    XMLWordPrintableJSON

Details

    Description

      The PackagedProgram class creates a user-code classloader to execute the programs main method.
      This classloader is a URLClassLoader (except in the case of some tests), which contains opened JarFiles for all accessed jars.

      The URLClassLoader class implements Closeable for the purpose of cleaning up closeable resources, however we never actually call this method. The PackagedProgram only works against the ClassLoader class, which doesn't implement Closeable.

      As a result, deleting a jar after submitting it with the JarRunHandler currently fails on Windows, since the jar is still in use.

      As far as i can tell after the JobGraph has been compiled this classloader is no longer necessary and should be closed. (This assumes that a given PackagedProgram is only used once to create a JobGraph}}, otherwise we'd needa dedicate close method)

      Attachments

        Issue Links

          Activity

            People

              chesnay Chesnay Schepler
              chesnay Chesnay Schepler
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: