mirror of
https://github.com/minio/minio.git
synced 2025-04-20 18:44:21 -04:00
fix: infinite loop in cleanupStaleUploads of encrypted MPUs (#10845)
fixes #10588
This commit is contained in:
parent
9bf5990ea9
commit
54120107ce
@ -710,10 +710,10 @@ func (l *s3EncObjects) cleanupStaleEncMultipartUploads(ctx context.Context, clea
|
|||||||
|
|
||||||
// cleanupStaleUploads removes old custom encryption multipart uploads on backend
|
// cleanupStaleUploads removes old custom encryption multipart uploads on backend
|
||||||
func (l *s3EncObjects) cleanupStaleUploads(ctx context.Context, expiry time.Duration) {
|
func (l *s3EncObjects) cleanupStaleUploads(ctx context.Context, expiry time.Duration) {
|
||||||
for {
|
|
||||||
buckets, err := l.s3Objects.ListBuckets(ctx)
|
buckets, err := l.s3Objects.ListBuckets(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
break
|
logger.LogIf(ctx, err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
for _, b := range buckets {
|
for _, b := range buckets {
|
||||||
expParts := l.getStalePartsForBucket(ctx, b.Name, expiry)
|
expParts := l.getStalePartsForBucket(ctx, b.Name, expiry)
|
||||||
@ -722,7 +722,6 @@ func (l *s3EncObjects) cleanupStaleUploads(ctx context.Context, expiry time.Dura
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
func (l *s3EncObjects) getStalePartsForBucket(ctx context.Context, bucket string, expiry time.Duration) (expParts map[string]string) {
|
func (l *s3EncObjects) getStalePartsForBucket(ctx context.Context, bucket string, expiry time.Duration) (expParts map[string]string) {
|
||||||
var prefix, continuationToken, delimiter, startAfter string
|
var prefix, continuationToken, delimiter, startAfter string
|
||||||
@ -731,6 +730,7 @@ func (l *s3EncObjects) getStalePartsForBucket(ctx context.Context, bucket string
|
|||||||
for {
|
for {
|
||||||
loi, err := l.s3Objects.ListObjectsV2(ctx, bucket, prefix, continuationToken, delimiter, 1000, false, startAfter)
|
loi, err := l.s3Objects.ListObjectsV2(ctx, bucket, prefix, continuationToken, delimiter, 1000, false, startAfter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
logger.LogIf(ctx, err)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
for _, obj := range loi.Objects {
|
for _, obj := range loi.Objects {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user