[ 
https://issues.apache.org/jira/browse/HIVE-6755?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrey Stepachev updated HIVE-6755:
-----------------------------------

    Description: 
Driver holds instance for ZkHiveLockManager. In turn SqlQuery holds it too. So 
if we have many not closed queries we will get many zk sessions.


  was:
Code below in case of any errors in zooKeeper.create statement leaves unclosed 
zookeeper instance.
Thats lead to connection exhausting on zookeeper over time.

{code:title=ZooKeeperHiveLockManager.java|borderStyle=solid}
    try {
      renewZookeeperInstance(sessionTimeout, quorumServers);
      parent = conf.getVar(HiveConf.ConfVars.HIVE_ZOOKEEPER_NAMESPACE);

      try {
        zooKeeper.create("/" +  parent, new byte[0], Ids.OPEN_ACL_UNSAFE, 
CreateMode.PERSISTENT);
      } catch (KeeperException e) {
        // ignore if the parent already exists
        if (e.code() != KeeperException.Code.NODEEXISTS) {
          LOG.warn("Unexpected ZK exception when creating parent node /" + 
parent, e);
        }
      }

    } catch (Exception e) {
      LOG.error("Failed to create ZooKeeper object: ", e);
      throw new 
LockException(ErrorMsg.ZOOKEEPER_CLIENT_COULD_NOT_BE_INITIALIZED.getMsg());
}
{code}


> Zookeeper Lock Manager leaks zookeeper connections.
> ---------------------------------------------------
>
>                 Key: HIVE-6755
>                 URL: https://issues.apache.org/jira/browse/HIVE-6755
>             Project: Hive
>          Issue Type: Bug
>          Components: HiveServer2
>    Affects Versions: 0.12.0
>         Environment: cloudera cdh5b2
>            Reporter: Andrey Stepachev
>            Priority: Critical
>
> Driver holds instance for ZkHiveLockManager. In turn SqlQuery holds it too. 
> So if we have many not closed queries we will get many zk sessions.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to