mirror of
https://github.com/minio/minio.git
synced 2025-11-20 01:50:24 -05:00
xl/heal: Make healFile non-blocking for StatFile and ReadFile. (#1399)
Fixes #1355
This commit is contained in:
17
xl-v1.go
17
xl-v1.go
@@ -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