[
https://issues.apache.org/jira/browse/HIVE-16213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15996498#comment-15996498
]
Lefty Leverenz commented on HIVE-16213:
---------------------------------------
Does any of this need to be documented in the wiki?
bq. Is there an explicit documentation that states that rollbackTransaction()
will never throw an exception?
and ...
{quote}
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.
{quote}
> ObjectStore can leak Queries when rollbackTransaction throws an exception
> -------------------------------------------------------------------------
>
> 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
> Fix For: 3.0.0, 2.4.0
>
> Attachments: HIVE-16213.01.patch, HIVE-16213.02.patch,
> HIVE-16213.03.patch, HIVE-16213.04.patch, HIVE-16213.05.patch,
> HIVE-16213.06.patch, HIVE-16213.07.patch, HIVE-16213.08.patch
>
>
> 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)