mirror of
https://github.com/minio/minio.git
synced 2026-11-28 23:32:50 +00:00
xl/heal: Make healFile non-blocking for StatFile and ReadFile. (#1399)
Fixes #1355
This commit is contained in:
1 parent
b51bef85e6
commit
5fffd558d0
3 files changed
+25
-18
No files matched your search
@@ -536,13 +536,16 @@ func (xl XL) StatFile(volume, path string) (FileInfo, error) {
|
||||
}
|
||||
|
||||
if heal {
|
||||
if err = xl.healFile(volume, path); err != nil {
|
||||
log.WithFields(logrus.Fields{
|
||||
"volume": volume,
|
||||
"path": path,
|
||||
}).Errorf("healFile failed with %s", err)
|
||||
return FileInfo{}, err
|
||||
}
|
||||
// Heal in background safely, since we already have read quorum disks.
|
||||
go func() {
|
||||
if err = xl.healFile(volume, path); err != nil {
|
||||
log.WithFields(logrus.Fields{
|
||||
"volume": volume,
|
||||
"path": path,
|
||||
}).Errorf("healFile failed with %s", err)
|
||||
return
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
// Extract metadata.
|
||||
|
||||
Reference in new issue
Block a user