Ensure the query is always "killed" after it is finished

If the http.CloseNotifier didn't go off for some reason (and it's not
guaranteed to go off just because the HTTP connection is closed), the
query wouldn't get correctly recycled when chunked output was requested.

The query id in the query executor was also not being set correctly.
This seems to have been an oversight when merging the point limit
monitor.
pull/6166/head
Jonathan A. Sternberg 2016-03-31 15:27:29 -04:00
parent c8d59f5e00
commit d9b32ea160
1 changed files with 3 additions and 1 deletions

View File

@ -94,7 +94,7 @@ func (e *QueryExecutor) executeQuery(query *influxql.Query, database string, chu
var qid uint64
if e.QueryManager != nil {
var err error
_, closing, err = e.QueryManager.AttachQuery(&influxql.QueryParams{
qid, closing, err = e.QueryManager.AttachQuery(&influxql.QueryParams{
Query: query,
Database: database,
Timeout: e.QueryTimeout,
@ -105,6 +105,8 @@ func (e *QueryExecutor) executeQuery(query *influxql.Query, database string, chu
results <- &influxql.Result{Err: err}
return
}
defer e.QueryManager.KillQuery(qid)
}
logger := e.logger()