make sure we close the iterators after we query

pull/292/head
John Shahid 2014-03-03 16:15:36 -05:00
parent 6653b40380
commit 1565e554b2
1 changed files with 5 additions and 0 deletions

View File

@ -173,6 +173,11 @@ func (self *LevelDbShard) executeQueryForSeries(querySpec *parser.QuerySpec, ser
}
fieldNames, iterators := self.getIterators(fields, startTimeBytes, endTimeBytes, query.Ascending)
defer func() {
for _, it := range iterators {
it.Close()
}
}()
// TODO: clean up, this is super gnarly
// optimize for the case where we're pulling back only a single column or aggregate