From 070c31eac5fa3ae329dfe556146cb4468923247c Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Wed, 19 Jan 2022 00:46:43 -0800 Subject: [PATCH] Wait for updates collector when disk.NSScanner returns error (#14127) --- cmd/erasure.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/erasure.go b/cmd/erasure.go index e601d46a9..3a27a280c 100644 --- a/cmd/erasure.go +++ b/cmd/erasure.go @@ -517,6 +517,11 @@ func (er erasureObjects) nsScanner(ctx context.Context, buckets []BucketInfo, bf } else { logger.LogIf(ctx, err) } + // This ensures that we don't close + // bucketResults channel while the + // updates-collector goroutine still + // holds a reference to this. + wg.Wait() continue }