fix: DeleteMultipleObjects to finish even if cancelled + concurrent sets (#14038)

* Process sets concurrently.
* Disconnect context from request.
* Insert context cancellation checks.
* errFileNotFound and errFileVersionNotFound are ok, unless creating delete markers.
This commit is contained in:
Klaus Post
2022-01-06 10:47:49 -08:00
committed by GitHub
parent c27110e37d
commit 0e31cff762
7 changed files with 71 additions and 13 deletions

View File

@@ -159,10 +159,15 @@ func toObjectErr(err error, params ...string) error {
apiErr.Object = decodeDirObject(params[1])
}
return apiErr
case io.ErrUnexpectedEOF.Error(), io.ErrShortWrite.Error():
return IncompleteBody{}
case context.Canceled.Error(), context.DeadlineExceeded.Error():
return IncompleteBody{}
case io.ErrUnexpectedEOF.Error(), io.ErrShortWrite.Error(), context.Canceled.Error(), context.DeadlineExceeded.Error():
apiErr := IncompleteBody{}
if len(params) >= 1 {
apiErr.Bucket = params[0]
}
if len(params) >= 2 {
apiErr.Object = decodeDirObject(params[1])
}
return apiErr
}
return err
}