Fix scanner deadlock on lost global lock (#16726)

This commit is contained in:
Klaus Post authored and GitHub committed 2023-02-28 21:34:45 -08:00
1 parent 47dfa62384
commit d07089ceac
2 files changed
+11 -5

No files matched your search

+2
View File
@@ -689,9 +689,11 @@ func (z *erasureServerPools) NSScanner(ctx context.Context, updates chan<- DataU
case updateCloser <- ch:
<-ch
case <-ctx.Done():
mu.Lock()
if firstErr == nil {
firstErr = ctx.Err()
}
defer mu.Unlock()
}
return firstErr
}