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.
This commit is contained in:
Seebs 2021-02-26 14:26:02 -06:00
parent 29fddd40f6
commit 7d15fc2f26

View file

@ -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.