fix: CrawlAndGetDataUsage close pipe() before using a new one (#11600)

also additionally make sure errors during deserializer closes
the reader with right error type such that Write() end
actually see the final error, this avoids a waitGroup usage
and waiting.
This commit is contained in:
Harshavardhana
2021-02-22 10:04:32 -08:00
committed by GitHub
parent 8778828a03
commit c31d2c3fdc
3 changed files with 8 additions and 12 deletions

View File

@@ -485,7 +485,7 @@ type objectIO interface {
// Only backend errors are returned as errors.
// If the object is not found or unable to deserialize d is cleared and nil error is returned.
func (d *dataUsageCache) load(ctx context.Context, store objectIO, name string) error {
r, err := store.GetObjectNInfo(ctx, dataUsageBucket, name, nil, http.Header{}, readLock, ObjectOptions{})
r, err := store.GetObjectNInfo(ctx, dataUsageBucket, name, nil, http.Header{}, noLock, ObjectOptions{})
if err != nil {
switch err.(type) {
case ObjectNotFound: