From f77a0e5aba54d6fec28de964c2865f5caddac0fd Mon Sep 17 00:00:00 2001 From: Thomas Jackson Date: Thu, 30 Mar 2023 08:11:48 -0700 Subject: [PATCH] Correct error check for child walk This was checking another error not childErr -- which would skip child errors and cause issues. I haven't seen this in practice but found while debugging another issue. --- promql/parser/ast.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/promql/parser/ast.go b/promql/parser/ast.go index d9117b988e..da7084300f 100644 --- a/promql/parser/ast.go +++ b/promql/parser/ast.go @@ -357,7 +357,7 @@ func Walk(ctx context.Context, v Visitor, s *EvalStmt, node Node, path []Node, n wg.Add(1) go func(i int, e Node) { defer wg.Done() - if childNode, childErr := Walk(ctx, v, s, e, append([]Node{}, path...), nr); err != nil { + if childNode, childErr := Walk(ctx, v, s, e, append([]Node{}, path...), nr); childErr != nil { errs[i] = childErr } else { newChildren[i] = childNode