hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Kolbasov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-16213) ObjectStore can leak Queries when rolbackTransaction
Date Wed, 15 Mar 2017 03:05:41 GMT

    [ https://issues.apache.org/jira/browse/HIVE-16213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15925459#comment-15925459
] 

Alexander Kolbasov commented on HIVE-16213:
-------------------------------------------

Seems that Datanucleus exceptions inherit from NucleusException which extends RuntimeException
which is an unchecked exception - that's why IDE doesn't complain when it isn't documented.
Looking at the source code I see a few exceptions that can be thrown:

* NucleusUserException
* NucleusDataStoreException
* TransactionNotActiveException - probably shouldn't get this one in this particular case
* NucleusTransactionException

may be something else - difficult to tell.

Seems that none of these are documented.

> 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
>            Assignee: Vihang Karajgaonkar
>
> 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)

Mime
View raw message