Ensure no ops are leaked in renderView().

Change-Id: I6970a9098be305fcd010d46443b040d864d9740a
This commit is contained in:
Julius Volz 2014-03-07 14:33:13 +01:00
parent 5745ce0a60
commit dd4892dcad
1 changed files with 2 additions and 1 deletions

View File

@ -422,6 +422,8 @@ func (t *TieredStorage) renderView(viewJob viewJob) {
extractionTimer := viewJob.stats.GetTimer(stats.ViewDataExtractionTime).Start()
for viewJob.builder.HasOp() {
op := viewJob.builder.PopOp()
defer giveBackOp(op)
fp := op.Fingerprint()
old, err := t.seriesTooOld(fp, op.CurrentTime())
if err != nil {
@ -525,7 +527,6 @@ func (t *TieredStorage) renderView(viewJob viewJob) {
view.appendSamples(fp, op.ExtractSamples(Values(currentChunk)))
}
}
giveBackOp(op)
}
extractionTimer.Stop()