You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kylin.apache.org by "Ted Yu (JIRA)" <ji...@apache.org> on 2017/12/14 22:06:00 UTC

[jira] [Created] (KYLIN-3111) Close of Admin instance should be placed in finally block

Ted Yu created KYLIN-3111:
-----------------------------

             Summary: Close of Admin instance should be placed in finally block
                 Key: KYLIN-3111
                 URL: https://issues.apache.org/jira/browse/KYLIN-3111
             Project: Kylin
          Issue Type: Bug
            Reporter: Ted Yu


Looking at the code in DeployCoprocessorCLI.java and HtableAlterMetadataCLI.java , I see that close of Admin instance is without finally block:
{code}
        hbaseAdmin.disableTable(table.getTableName());
        table.setValue(metadataKey, metadataValue);
        hbaseAdmin.modifyTable(table.getTableName(), table);
        hbaseAdmin.enableTable(table.getTableName());
        hbaseAdmin.close();
{code}
If any exception is thrown in the operations prior to the close(), the close() would be skipped, leading to resource leak.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)