[
https://issues.apache.org/jira/browse/PHOENIX-1650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14315457#comment-14315457
]
Rajeshbabu Chintaguntla commented on PHOENIX-1650:
--------------------------------------------------
Thanks [~jamestaylor].
> Possible resource leak in upsert select query
> ---------------------------------------------
>
> Key: PHOENIX-1650
> URL: https://issues.apache.org/jira/browse/PHOENIX-1650
> Project: Phoenix
> Issue Type: Bug
> Reporter: Rajeshbabu Chintaguntla
> Assignee: Rajeshbabu Chintaguntla
> Priority: Critical
> Fix For: 5.0.0, 4.3
>
> Attachments: PHOENIX-1650.patch
>
>
> In the upsert select query execution path if parallelIteratorFactory then we
> are not closing the iterator which results in resource leak.
> {code}
> ResultIterator iterator = queryPlan.iterator();
> if (parallelIteratorFactory == null) {
> return upsertSelect(statement, tableRef, projector,
> iterator, columnIndexes, pkSlotIndexes);
> }
> parallelIteratorFactory.setRowProjector(projector);
> parallelIteratorFactory.setColumnIndexes(columnIndexes);
> parallelIteratorFactory.setPkSlotIndexes(pkSlotIndexes);
> Tuple tuple;
> long totalRowCount = 0;
> while ((tuple=iterator.next()) != null) {// Runs query
> Cell kv = tuple.getValue(0);
> totalRowCount +=
> PLong.INSTANCE.getCodec().decodeLong(kv.getValueArray(), kv.getValueOffset(),
> SortOrder.getDefault());
> }
> // Return total number of rows that have been updated. In
> the case of auto commit being off
> // the mutations will all be in the mutation state of the
> current connection.
> return new MutationState(maxSize,
> statement.getConnection(), totalRowCount);
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)