mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05: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:
@@ -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