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
parent
c8d59f5e00
commit
d9b32ea160
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue