You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@oozie.apache.org by "Peter Bacsko (JIRA)" <ji...@apache.org> on 2016/05/27 21:55:13 UTC
[jira] [Updated] (OOZIE-2541) Resource leak in Hive2Credentials
[ https://issues.apache.org/jira/browse/OOZIE-2541?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Peter Bacsko updated OOZIE-2541:
--------------------------------
Description:
Connection to Hive is not closed properly in case of a possible SQLException:
{code}
Connection con = DriverManager.getConnection(url);
XLog.getLog(getClass()).debug("Connected successfully to " + url);
// get delegation token for the given proxy user
String tokenStr = ((HiveConnection)con).getDelegationToken(jobconf.get(USER_NAME), principal);
XLog.getLog(getClass()).debug("Got token");
{code}
Update this piece of code to try-with-resources structure.
was:
Connection to Hive is not closed properly in case of a possible SQLException:
{code}
Connection con = DriverManager.getConnection(url);
XLog.getLog(getClass()).debug("Connected successfully to " + url);
// get delegation token for the given proxy user
String tokenStr = ((HiveConnection)con).getDelegationToken(jobconf.get(USER_NAME), principal);
XLog.getLog(getClass()).debug("Got token");
{code}
Update this piece of code to try-with-resources structure.
> Resource leak in Hive2Credentials
> ---------------------------------
>
> Key: OOZIE-2541
> URL: https://issues.apache.org/jira/browse/OOZIE-2541
> Project: Oozie
> Issue Type: Bug
> Components: core
> Reporter: Peter Bacsko
> Assignee: Peter Bacsko
> Priority: Trivial
>
> Connection to Hive is not closed properly in case of a possible SQLException:
> {code}
> Connection con = DriverManager.getConnection(url);
> XLog.getLog(getClass()).debug("Connected successfully to " + url);
> // get delegation token for the given proxy user
> String tokenStr = ((HiveConnection)con).getDelegationToken(jobconf.get(USER_NAME), principal);
> XLog.getLog(getClass()).debug("Got token");
> {code}
> Update this piece of code to try-with-resources structure.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)