Purshotam Shah created HIVE-18532: ------------------------------------- Summary: Hive Connection can't be closed if there is an error while creating session Key: HIVE-18532 URL: https://issues.apache.org/jira/browse/HIVE-18532 Project: Hive Issue Type: Bug Reporter: Purshotam Shah
To open a hiveconnection we have to {code} HiveConnection connection = null; try { connection = new HiveConnection(uri, new Properties()); } finally { if (connection != null) try { connection.close(); } catch (SQLException e) { LOGGER.error("Error closing connection, ignored.", e); } } {code} HiveConnection opens the opensTransport and tries to create a session in the constructor. If opensTransport succeed, but session creates fails because of namenode error or any other error, HiveConnection can't be closed. Since construction fails, the hiveconnection object will be null and the client can't close it. -- This message was sent by Atlassian JIRA (v7.6.3#76005)