Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 92DDF200D58 for ; Sun, 17 Dec 2017 10:19:06 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 912B8160C17; Sun, 17 Dec 2017 09:19:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D71C8160BFF for ; Sun, 17 Dec 2017 10:19:05 +0100 (CET) Received: (qmail 67746 invoked by uid 500); 17 Dec 2017 09:19:05 -0000 Mailing-List: contact issues-help@kylin.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kylin.apache.org Delivered-To: mailing list issues@kylin.apache.org Received: (qmail 67737 invoked by uid 99); 17 Dec 2017 09:19:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 Dec 2017 09:19:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id A7573180724 for ; Sun, 17 Dec 2017 09:19:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id S0jfcX5ML9P9 for ; Sun, 17 Dec 2017 09:19:04 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 344695F297 for ; Sun, 17 Dec 2017 09:19:03 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id D5F2FE0F61 for ; Sun, 17 Dec 2017 09:19:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 3A413240E6 for ; Sun, 17 Dec 2017 09:19:00 +0000 (UTC) Date: Sun, 17 Dec 2017 09:19:00 +0000 (UTC) From: "Chao Long (JIRA)" To: issues@kylin.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (KYLIN-3111) Close of Admin instance should be placed in finally block MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 17 Dec 2017 09:19:06 -0000 [ https://issues.apache.org/jira/browse/KYLIN-3111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16294053#comment-16294053 ] Chao Long commented on KYLIN-3111: ---------------------------------- Thanks [~lidong_sjtu] for your suggestions! I have updated the commit infomation and attached a new patch! > 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 > Assignee: Chao Long > Attachments: KYLIN-3111-Place-close-of-admin-instance-into-finally-block.patch > > > 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)