Check for timeout in each iteration of matrixSelector (#4300)

Signed-off-by: Thomas Jackson <jacksontj.89@gmail.com>

Fixes #4288
This commit is contained in:
Thomas Jackson 2018-06-21 14:43:31 -07:00 committed by Brian Brazil
parent 78e0784d04
commit a6dace8829
1 changed files with 3 additions and 0 deletions

View File

@ -1044,6 +1044,9 @@ func (ev *evaluator) matrixSelector(node *MatrixSelector) Matrix {
var it *storage.BufferedSeriesIterator
for i, s := range node.series {
if err := contextDone(ev.ctx, "expression evaluation"); err != nil {
ev.error(err)
}
if it == nil {
it = storage.NewBuffer(s.Iterator(), durationMilliseconds(node.Range))
} else {