You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Rajeshbabu Chintaguntla (JIRA)" <ji...@apache.org> on 2015/02/11 01:10:12 UTC

[jira] [Created] (PHOENIX-1650) Possible leak in upsert select query

Rajeshbabu Chintaguntla created PHOENIX-1650:
------------------------------------------------

             Summary: Possible 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


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)