[
https://issues.apache.org/jira/browse/FLINK-9844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17277874#comment-17277874
]
Chesnay Schepler commented on FLINK-9844:
-----------------------------------------
master: 3ff536149d0134ea8e7fb74f0d383c5b1b09041e
> PackagedProgram does not close URLClassLoader
> ---------------------------------------------
>
> Key: FLINK-9844
> URL: https://issues.apache.org/jira/browse/FLINK-9844
> Project: Flink
> Issue Type: Improvement
> Components: Command Line Client
> Affects Versions: 1.4.2, 1.5.1, 1.6.0
> Reporter: Chesnay Schepler
> Assignee: Chesnay Schepler
> Priority: Major
> Labels: pull-request-available
>
> 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)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)