mirror of
https://github.com/minio/minio.git
synced 2025-02-27 13:29:15 -05:00
listcache: Wrap returned errors (#10882)
To give an indication of where they happen
This commit is contained in:
parent
80b8ce89a4
commit
10099357b6
@ -342,7 +342,6 @@ func (r *metacacheReader) filter(o listPathOptions) (entries metaCacheEntriesSor
|
|||||||
|
|
||||||
func (er *erasureObjects) streamMetadataParts(ctx context.Context, o listPathOptions) (entries metaCacheEntriesSorted, err error) {
|
func (er *erasureObjects) streamMetadataParts(ctx context.Context, o listPathOptions) (entries metaCacheEntriesSorted, err error) {
|
||||||
retries := 0
|
retries := 0
|
||||||
const debugPrint = false
|
|
||||||
rpc := globalNotificationSys.restClientFromHash(o.Bucket)
|
rpc := globalNotificationSys.restClientFromHash(o.Bucket)
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
@ -354,11 +353,8 @@ func (er *erasureObjects) streamMetadataParts(ctx context.Context, o listPathOpt
|
|||||||
// If many failures, check the cache state.
|
// If many failures, check the cache state.
|
||||||
if retries > 10 {
|
if retries > 10 {
|
||||||
err := o.checkMetacacheState(ctx, rpc)
|
err := o.checkMetacacheState(ctx, rpc)
|
||||||
if debugPrint {
|
|
||||||
logger.Info("waiting for first part (%s), err: %v", o.objectPath(0), err)
|
|
||||||
}
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return entries, err
|
return entries, fmt.Errorf("remote listing canceled: %w", err)
|
||||||
}
|
}
|
||||||
retries = 1
|
retries = 1
|
||||||
}
|
}
|
||||||
@ -396,11 +392,7 @@ func (er *erasureObjects) streamMetadataParts(ctx context.Context, o listPathOpt
|
|||||||
time.Sleep(retryDelay)
|
time.Sleep(retryDelay)
|
||||||
continue
|
continue
|
||||||
default:
|
default:
|
||||||
if debugPrint {
|
return entries, fmt.Errorf("reading first part metadata: %w", err)
|
||||||
console.Infoln("first getObjectFileInfo", o.objectPath(0), "returned err:", err)
|
|
||||||
console.Infof("err type: %T\n", err)
|
|
||||||
}
|
|
||||||
return entries, err
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if fi.Deleted {
|
if fi.Deleted {
|
||||||
@ -413,11 +405,8 @@ func (er *erasureObjects) streamMetadataParts(ctx context.Context, o listPathOpt
|
|||||||
case io.ErrUnexpectedEOF:
|
case io.ErrUnexpectedEOF:
|
||||||
if retries == 10 {
|
if retries == 10 {
|
||||||
err := o.checkMetacacheState(ctx, rpc)
|
err := o.checkMetacacheState(ctx, rpc)
|
||||||
if debugPrint {
|
|
||||||
logger.Info("waiting for metadata, err: %v", err)
|
|
||||||
}
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return entries, err
|
return entries, fmt.Errorf("remote listing canceled: %w", err)
|
||||||
}
|
}
|
||||||
retries = -1
|
retries = -1
|
||||||
}
|
}
|
||||||
@ -441,11 +430,8 @@ func (er *erasureObjects) streamMetadataParts(ctx context.Context, o listPathOpt
|
|||||||
if partN != loadedPart {
|
if partN != loadedPart {
|
||||||
if retries > 10 {
|
if retries > 10 {
|
||||||
err := o.checkMetacacheState(ctx, rpc)
|
err := o.checkMetacacheState(ctx, rpc)
|
||||||
if debugPrint {
|
|
||||||
logger.Info("waiting for part data (%v), err: %v", o.objectPath(partN), err)
|
|
||||||
}
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return entries, err
|
return entries, fmt.Errorf("waiting for next part %d: %w", partN, err)
|
||||||
}
|
}
|
||||||
retries = 1
|
retries = 1
|
||||||
}
|
}
|
||||||
@ -532,6 +518,7 @@ func (er *erasureObjects) streamMetadataParts(ctx context.Context, o listPathOpt
|
|||||||
// We stopped within the listing, we are done for now...
|
// We stopped within the listing, we are done for now...
|
||||||
return entries, nil
|
return entries, nil
|
||||||
default:
|
default:
|
||||||
|
logger.LogIf(ctx, err)
|
||||||
return entries, err
|
return entries, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user