mirror of https://github.com/apache/druid.git
proper closing of resources in case of query cancellation
This commit is contained in:
parent
1be85af320
commit
32f6243be0
|
@ -60,6 +60,7 @@ public class TimeseriesQueryEngine
|
||||||
{
|
{
|
||||||
Aggregator[] aggregators = QueryRunnerHelper.makeAggregators(cursor, aggregatorSpecs);
|
Aggregator[] aggregators = QueryRunnerHelper.makeAggregators(cursor, aggregatorSpecs);
|
||||||
|
|
||||||
|
try {
|
||||||
while (!cursor.isDone()) {
|
while (!cursor.isDone()) {
|
||||||
for (Aggregator aggregator : aggregators) {
|
for (Aggregator aggregator : aggregators) {
|
||||||
aggregator.aggregate();
|
aggregator.aggregate();
|
||||||
|
@ -74,13 +75,14 @@ public class TimeseriesQueryEngine
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<TimeseriesResultValue> retVal = bob.build();
|
Result<TimeseriesResultValue> retVal = bob.build();
|
||||||
|
return retVal;
|
||||||
|
}
|
||||||
|
finally {
|
||||||
// cleanup
|
// cleanup
|
||||||
for (Aggregator agg : aggregators) {
|
for (Aggregator agg : aggregators) {
|
||||||
agg.close();
|
agg.close();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return retVal;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue