reload bucket metadata outside the locker (#9659)

master
Harshavardhana 5 years ago committed by GitHub
parent 2164984d2b
commit baa30f4289
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      cmd/bucket-metadata-sys.go

@ -258,9 +258,9 @@ func (sys *BucketMetadataSys) GetConfig(bucket string) (BucketMetadata, error) {
return newBucketMetadata(bucket), errInvalidArgument
}
sys.Lock()
defer sys.Unlock()
sys.RLock()
meta, ok := sys.metadataMap[bucket]
sys.RUnlock()
if ok {
return meta, nil
}
@ -268,7 +268,9 @@ func (sys *BucketMetadataSys) GetConfig(bucket string) (BucketMetadata, error) {
if err != nil {
return meta, err
}
sys.Lock()
sys.metadataMap[bucket] = meta
sys.Unlock()
return meta, nil
}

Loading…
Cancel
Save