Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
None
-
None
-
None
Description
In the upsert select query execution path if parallelIteratorFactory then we are not closing the iterator which results in resource leak.
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);