mirror of
https://github.com/minio/minio.git
synced 2026-11-13 14:44:19 +00:00
Save listing error async (#10922)
Since the RPC call may have to time out save an error state async to not hold up the listing returning. Fixes #10919
This commit is contained in:
1 parent
d1b1fee080
commit
e413f05397
2 files changed
+22
-14
No files matched your search
@@ -560,13 +560,15 @@ func (er *erasureObjects) listPath(ctx context.Context, o listPathOptions) (entr
|
||||
console.Println("listPath returning:", entries.len(), "err:", err)
|
||||
}
|
||||
if err != nil && err != io.EOF {
|
||||
metaMu.Lock()
|
||||
if meta.status != scanStateError {
|
||||
meta.error = err.Error()
|
||||
meta.status = scanStateError
|
||||
}
|
||||
meta, _ = o.updateMetacacheListing(meta, rpc)
|
||||
metaMu.Unlock()
|
||||
go func(err string) {
|
||||
metaMu.Lock()
|
||||
if meta.status != scanStateError {
|
||||
meta.error = err
|
||||
meta.status = scanStateError
|
||||
}
|
||||
meta, _ = o.updateMetacacheListing(meta, rpc)
|
||||
metaMu.Unlock()
|
||||
}(err.Error())
|
||||
cancel()
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in new issue
Block a user