Return-Path: X-Original-To: apmail-hive-issues-archive@minotaur.apache.org Delivered-To: apmail-hive-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 510301846C for ; Wed, 6 Jan 2016 20:57:40 +0000 (UTC) Received: (qmail 18008 invoked by uid 500); 6 Jan 2016 20:57:40 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 17967 invoked by uid 500); 6 Jan 2016 20:57:40 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 17955 invoked by uid 99); 6 Jan 2016 20:57:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jan 2016 20:57:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id C80BB2C0453 for ; Wed, 6 Jan 2016 20:57:39 +0000 (UTC) Date: Wed, 6 Jan 2016 20:57:39 +0000 (UTC) From: "Thejas M Nair (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-12790) Metastore connection leaks in HiveServer2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-12790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15086265#comment-15086265 ] Thejas M Nair commented on HIVE-12790: -------------------------------------- bq. The last line above launches a new thread and the first message from that new thread is That is not what i expect. I expect new thread to be launched later at - tskRun.start(); (that gets called when hive.exec.parallel=true). bq. Hive.get() should return a shared instance That returns a thread local instance if it already exists. In this case this is a new thread, so new instances gets created. You can close that one if a separate thread was used for task execution > Metastore connection leaks in HiveServer2 > ----------------------------------------- > > Key: HIVE-12790 > URL: https://issues.apache.org/jira/browse/HIVE-12790 > Project: Hive > Issue Type: Bug > Components: HiveServer2 > Affects Versions: 1.1.0 > Reporter: Naveen Gangam > Assignee: Naveen Gangam > Attachments: HIVE-12790.patch, snippedLog.txt > > > HiveServer2 keeps opening new connections to HMS each time it launches a task. These connections do not appear to be closed when the task completes thus causing a HMS connection leak. "lsof" for the HS2 process shows connections to port 9083. > {code} > 2015-12-03 04:20:56,352 INFO [HiveServer2-Background-Pool: Thread-424756()]: ql.Driver (SessionState.java:printInfo(558)) - Launching Job 11 out of 41 > 2015-12-03 04:20:56,354 INFO [Thread-405728()]: hive.metastore (HiveMetaStoreClient.java:open(311)) - Trying to connect to metastore with URI thrift://:9083 > 2015-12-03 04:20:56,360 INFO [Thread-405728()]: hive.metastore (HiveMetaStoreClient.java:open(351)) - Opened a connection to metastore, current connections: 14824 > 2015-12-03 04:20:56,360 INFO [Thread-405728()]: hive.metastore (HiveMetaStoreClient.java:open(400)) - Connected to metastore. > .... > 2015-12-03 04:21:06,355 INFO [HiveServer2-Background-Pool: Thread-424756()]: ql.Driver (SessionState.java:printInfo(558)) - Launching Job 12 out of 41 > 2015-12-03 04:21:06,357 INFO [Thread-405756()]: hive.metastore (HiveMetaStoreClient.java:open(311)) - Trying to connect to metastore with URI thrift://:9083 > 2015-12-03 04:21:06,362 INFO [Thread-405756()]: hive.metastore (HiveMetaStoreClient.java:open(351)) - Opened a connection to metastore, current connections: 14825 > 2015-12-03 04:21:06,362 INFO [Thread-405756()]: hive.metastore (HiveMetaStoreClient.java:open(400)) - Connected to metastore. > ... > 2015-12-03 04:21:08,357 INFO [HiveServer2-Background-Pool: Thread-424756()]: ql.Driver (SessionState.java:printInfo(558)) - Launching Job 13 out of 41 > 2015-12-03 04:21:08,360 INFO [Thread-405782()]: hive.metastore (HiveMetaStoreClient.java:open(311)) - Trying to connect to metastore with URI thrift://:9083 > 2015-12-03 04:21:08,364 INFO [Thread-405782()]: hive.metastore (HiveMetaStoreClient.java:open(351)) - Opened a connection to metastore, current connections: 14826 > 2015-12-03 04:21:08,365 INFO [Thread-405782()]: hive.metastore (HiveMetaStoreClient.java:open(400)) - Connected to metastore. > ... > {code} > The TaskRunner thread starts a new SessionState each time, which creates a new connection to the HMS (via Hive.get(conf).getMSC()) that is never closed. > Even SessionState.close(), currently not being called by the TaskRunner thread, does not close this connection. > Attaching a anonymized log snippet where the number of HMS connections reaches north of 25000+ connections. -- This message was sent by Atlassian JIRA (v6.3.4#6332)