mirror of
https://github.com/minio/minio.git
synced 2025-11-22 02:35:30 -05:00
FS: sync abortMultipart cleanup and bg append (#3388)
backgroundAppend type's abort method should wait for appendParts to finish writing ongoing appending of parts in the background before cleaning up the part files.
This commit is contained in:
committed by
Harshavardhana
parent
d31f256020
commit
67509453d3
@@ -115,13 +115,14 @@ func (b *backgroundAppend) complete(disk StorageAPI, bucket, object, uploadID st
|
||||
// Called after complete-multipart-upload or abort-multipart-upload so that the appendParts go-routine is not left dangling.
|
||||
func (b *backgroundAppend) abort(uploadID string) {
|
||||
b.Lock()
|
||||
defer b.Unlock()
|
||||
info, ok := b.infoMap[uploadID]
|
||||
if !ok {
|
||||
b.Unlock()
|
||||
return
|
||||
}
|
||||
delete(b.infoMap, uploadID)
|
||||
close(info.abortCh)
|
||||
b.Unlock()
|
||||
info.abortCh <- struct{}{}
|
||||
}
|
||||
|
||||
// This is run as a go-routine that appends the parts in the background.
|
||||
|
||||
Reference in New Issue
Block a user