You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2018/10/23 22:56:00 UTC

[jira] [Commented] (IMPALA-7668) close() URLClassLoaders after usage.

    [ https://issues.apache.org/jira/browse/IMPALA-7668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16661427#comment-16661427 ] 

ASF subversion and git services commented on IMPALA-7668:
---------------------------------------------------------

Commit e0c54b7c8ee05a88cec6f4f7a479971c45271bbb in impala's branch refs/heads/master from Bharath Vissapragada
[ https://git-wip-us.apache.org/repos/asf?p=impala.git;h=e0c54b7 ]

IMPALA-7668: Proper clean up of URLClassLoader

Starting with Java 7 URLClassLoader implements a close() method that
cleans up any open files and helps avoid bugs like fd leaks inside the
class loader. Additionally it also helps load updated class versions
of the classes that are loaded already by prior instances.

This commit makes sure that the URLClassLoader is close()'d in a few
places in the code.

Testing: Tricky to automate the tests for this behavior, so no new
tests were added.

Change-Id: I5c5100ef5c5a97d92d94fb68daab622f0aa30158
Reviewed-on: http://gerrit.cloudera.org:8080/11594
Reviewed-by: Bharath Vissapragada <bh...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


> close() URLClassLoaders after usage.
> ------------------------------------
>
>                 Key: IMPALA-7668
>                 URL: https://issues.apache.org/jira/browse/IMPALA-7668
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Frontend
>            Reporter: bharath v
>            Assignee: bharath v
>            Priority: Major
>             Fix For: Impala 3.1.0
>
>
> There are a few places in the code that uses URLClassLoaders to load some java classes at runtime. One example is when loading Java UDFs at startup.
> {code:java}
> public static List<Function> extractFunctions(String db,
>       ...........
>       URL[] classLoaderUrls = new URL[] {new URL(localJarPath.toString())};
>       URLClassLoader urlClassLoader = new URLClassLoader(classLoaderUrls);
> {code}
> Starting JDK7, URLClassloader lets the caller close all the closeables opened by it, avoiding bugs like FD leaks etc.
> https://docs.oracle.com/javase/7/docs/api/java/net/URLClassLoader.html#close()
> We have seen issues like lingering FDs from this code using certain versions of JDKs where the FDs of temporary jars (copied to /tmp) by this code are not closed and hence their space from disk is not claimed causing disk space issues.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org