From 7d15fc2f2624e2aa871aaf656e4654aeea2bb116 Mon Sep 17 00:00:00 2001 From: Seebs Date: Fri, 26 Feb 2021 14:26:02 -0600 Subject: [PATCH] don't reduce errors with non-errors if we got an error, we don't have to merge it. so either ctx.Err or resp.err being non-nil means we shouldn't be reducing, but we still need to grab the responses to make sure we waited for them all. --- executor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/executor.go b/executor.go index 7add7487c..1b3848916 100644 --- a/executor.go +++ b/executor.go @@ -5786,7 +5786,7 @@ func (e *executor) mapperLocal(ctx context.Context, shards []uint64, mapFn mapFu if resp.err != nil && err == nil { err = resp.err } - if ctx.Err() == nil { + if resp.err == nil && ctx.Err() == nil { // Only useful to do a possibly-expensive // reduce if we don't already know we don't // need it.