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

[jira] [Created] (HIVE-16213) ObjectStore can leak Queries when rolbackTransaction

Alexander Kolbasov created HIVE-16213:
-----------------------------------------

             Summary: ObjectStore can leak Queries when rolbackTransaction 
                 Key: HIVE-16213
                 URL: https://issues.apache.org/jira/browse/HIVE-16213
             Project: Hive
          Issue Type: Bug
          Components: Hive
            Reporter: Alexander Kolbasov


In ObjectStore.java there are a few places with the code similar to:

{code}
    Query query = null;
    try {
      openTransaction();
      query = pm.newQuery(Something.class);
      ...
      commited = commitTransaction();
    } finally {
      if (!commited) {
        rollbackTransaction();
      }
      if (query != null) {
        query.closeAll();
      }
    }
{code}

The problem is that rollbackTransaction() may throw an exception in which case query.closeAll() wouldn't be executed. 

The fix would be to wrap rollbackTransaction in its own try-catch block.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)