mirror of
https://github.com/minio/minio.git
synced 2025-11-10 05:59:43 -05:00
Remove XL multipart tmp files when the latter is canceled (#3214)
XL multipart fails to remove tmp files when an error occurs during upload, this case covers the scenario where an upload is canceled manually by the client in the middle of job.
This commit is contained in:
committed by
Harshavardhana
parent
bef0a50bc1
commit
4098025c11
@@ -394,7 +394,8 @@ func (xl xlObjects) PutObjectPart(bucket, object, uploadID string, partID int, s
|
||||
|
||||
partSuffix := fmt.Sprintf("part.%d", partID)
|
||||
tmpSuffix := getUUID()
|
||||
tmpPartPath := tmpSuffix
|
||||
tmpPart := tmpSuffix
|
||||
tmpPartPath := path.Join(tmpSuffix, partSuffix)
|
||||
|
||||
// Initialize md5 writer.
|
||||
md5Writer := md5.New()
|
||||
@@ -424,7 +425,7 @@ func (xl xlObjects) PutObjectPart(bucket, object, uploadID string, partID int, s
|
||||
teeReader := io.TeeReader(lreader, mw)
|
||||
|
||||
// Delete the temporary object part. If PutObjectPart succeeds there would be nothing to delete.
|
||||
defer xl.deleteObject(minioMetaTmpBucket, tmpPartPath)
|
||||
defer xl.deleteObject(minioMetaTmpBucket, tmpPart)
|
||||
|
||||
if size > 0 {
|
||||
for _, disk := range onlineDisks {
|
||||
|
||||
Reference in New Issue
Block a user