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 45336200B5A for ; Wed, 20 Jul 2016 21:51:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 43CB6160A5B; Wed, 20 Jul 2016 19:51:22 +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 890D5160A64 for ; Wed, 20 Jul 2016 21:51:21 +0200 (CEST) Received: (qmail 12817 invoked by uid 500); 20 Jul 2016 19:51:20 -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 12612 invoked by uid 99); 20 Jul 2016 19:51:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jul 2016 19:51:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 92F6C2C0D5F for ; Wed, 20 Jul 2016 19:51:20 +0000 (UTC) Date: Wed, 20 Jul 2016 19:51:20 +0000 (UTC) From: "Mohit Sabharwal (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-14296) Session count is not decremented when HS2 clients do not shutdown cleanly. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 20 Jul 2016 19:51:22 -0000 [ https://issues.apache.org/jira/browse/HIVE-14296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15386506#comment-15386506 ] Mohit Sabharwal commented on HIVE-14296: ---------------------------------------- I'm wondering if use of ThriftCLIService#sessionCount is redundant. Shouldn't we be using SessionManager#getOpenSessionCount() count instead ? ThriftBinaryCLIService#deleteContext is already closing the session which will remove the value from SessionManager#handleToSession So, it seems to me that ThriftCLIService#sessionCount is not telling us anything that SessionManager#getOpenSessionCount() isn't already. > Session count is not decremented when HS2 clients do not shutdown cleanly. > -------------------------------------------------------------------------- > > Key: HIVE-14296 > URL: https://issues.apache.org/jira/browse/HIVE-14296 > Project: Hive > Issue Type: Bug > Components: HiveServer2 > Affects Versions: 2.0.0 > Reporter: Naveen Gangam > Assignee: Naveen Gangam > Attachments: HIVE-14296.patch > > > When a JDBC client like beeline abruptly disconnects from HS2, the session gets closed on the serverside but the session count reported in the logs is incorrect. It never gets decremented. > For example, I created 6 connections from the same instance of beeline to HS2. > {code} > 2016-07-20T15:05:17,987 INFO [HiveServer2-Handler-Pool: Thread-40] thrift.ThriftCLIService: Opened a session SessionHandle [28b225ee-204f-4b3e-b4fd-0039ef8e276e], current sessions: 1 > ..... > 2016-07-20T15:05:24,239 INFO [HiveServer2-Handler-Pool: Thread-45] thrift.ThriftCLIService: Opened a session SessionHandle [1d267de8-ff9a-4e76-ac5c-e82c871588e7], current sessions: 2 > ..... > 2016-07-20T15:05:25,710 INFO [HiveServer2-Handler-Pool: Thread-50] thrift.ThriftCLIService: Opened a session SessionHandle [04d53deb-8965-464b-aa3f-7042304cfb54], current sessions: 3 > ..... > 2016-07-20T15:05:26,795 INFO [HiveServer2-Handler-Pool: Thread-55] thrift.ThriftCLIService: Opened a session SessionHandle [b4bb8b86-74e1-4e3c-babb-674d34ad1caf], current sessions: 4 > 2016-07-20T15:05:28,160 INFO [HiveServer2-Handler-Pool: Thread-60] thrift.ThriftCLIService: Opened a session SessionHandle [6d3c3ed9-fadb-4673-8c15-3315b7e2995d], current sessions: 5 > ..... > 2016-07-20T15:05:29,136 INFO [HiveServer2-Handler-Pool: Thread-65] thrift.ThriftCLIService: Opened a session SessionHandle [88b630c0-f272-427d-8263-febfe2222f8d], current sessions: 6 > {code} > When I CNTRL-C the beeline process, in the HS2 logs I see > {code} > 2016-07-20T15:11:37,858 INFO [HiveServer2-Handler-Pool: Thread-55] thrift.ThriftCLIService: Session disconnected without closing properly. > 2016-07-20T15:11:37,858 INFO [HiveServer2-Handler-Pool: Thread-40] thrift.ThriftCLIService: Session disconnected without closing properly. > 2016-07-20T15:11:37,858 INFO [HiveServer2-Handler-Pool: Thread-65] thrift.ThriftCLIService: Session disconnected without closing properly. > 2016-07-20T15:11:37,858 INFO [HiveServer2-Handler-Pool: Thread-60] thrift.ThriftCLIService: Session disconnected without closing properly. > 2016-07-20T15:11:37,859 INFO [HiveServer2-Handler-Pool: Thread-50] thrift.ThriftCLIService: Session disconnected without closing properly. > 2016-07-20T15:11:37,859 INFO [HiveServer2-Handler-Pool: Thread-45] thrift.ThriftCLIService: Session disconnected without closing properly. > 2016-07-20T15:11:37,859 INFO [HiveServer2-Handler-Pool: Thread-55] thrift.ThriftCLIService: Closing the session: SessionHandle [b4bb8b86-74e1-4e3c-babb-674d34ad1caf] > 2016-07-20T15:11:37,859 INFO [HiveServer2-Handler-Pool: Thread-40] thrift.ThriftCLIService: Closing the session: SessionHandle [28b225ee-204f-4b3e-b4fd-0039ef8e276e] > 2016-07-20T15:11:37,859 INFO [HiveServer2-Handler-Pool: Thread-65] thrift.ThriftCLIService: Closing the session: SessionHandle [88b630c0-f272-427d-8263-febfe2222f8d] > 2016-07-20T15:11:37,859 INFO [HiveServer2-Handler-Pool: Thread-60] thrift.ThriftCLIService: Closing the session: SessionHandle [6d3c3ed9-fadb-4673-8c15-3315b7e2995d] > 2016-07-20T15:11:37,859 INFO [HiveServer2-Handler-Pool: Thread-45] thrift.ThriftCLIService: Closing the session: SessionHandle [1d267de8-ff9a-4e76-ac5c-e82c871588e7] > 2016-07-20T15:11:37,859 INFO [HiveServer2-Handler-Pool: Thread-50] thrift.ThriftCLIService: Closing the session: SessionHandle [04d53deb-8965-464b-aa3f-7042304cfb54] > {code} > The next time I connect to HS2 via beeline, I see > {code} > 2016-07-20T15:14:33,679 INFO [HiveServer2-Handler-Pool: Thread-50] thrift.ThriftCLIService: Client protocol version: HIVE_CLI_SERVICE_PROTOCOL_V8 > 2016-07-20T15:14:33,710 INFO [HiveServer2-Handler-Pool: Thread-50] session.SessionState: Created HDFS directory: /tmp/hive/hive/d47759e8-df3a-4504-9f28-99ff5247352c > 2016-07-20T15:14:33,725 INFO [HiveServer2-Handler-Pool: Thread-50] session.SessionState: Created local directory: /var/folders/_3/0w477k4j5bjd6h967rw4vflw0000gp/T/ngangam/d47759e8-df3a-4504-9f28-99ff5247352c > 2016-07-20T15:14:33,735 INFO [HiveServer2-Handler-Pool: Thread-50] session.SessionState: Created HDFS directory: /tmp/hive/hive/d47759e8-df3a-4504-9f28-99ff5247352c/_tmp_space.db > 2016-07-20T15:14:33,737 INFO [HiveServer2-Handler-Pool: Thread-50] session.HiveSessionImpl: Operation log session directory is created: /var/folders/_3/0w477k4j5bjd6h967rw4vflw0000gp/T/ngangam/operation_logs/d47759e8-df3a-4504-9f28-99ff5247352c > 2016-07-20T15:14:33,737 INFO [HiveServer2-Handler-Pool: Thread-50] thrift.ThriftCLIService: Opened a session SessionHandle [d47759e8-df3a-4504-9f28-99ff5247352c], current sessions: 7 > {code} > So while the sessions itself are closed and cleaned up, the session count reported is not accurate. -- This message was sent by Atlassian JIRA (v6.3.4#6332)