mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
api: Multi object delete should be protected. (#3814)
Add missing protection from deleting multiple objects in parallel. Currently we are deleting objects without proper locking through this API. This can cause significant amount of races.
This commit is contained in:
parent
097cec676a
commit
472fa4a6ca
@ -277,7 +277,11 @@ func (api objectAPIHandlers) DeleteMultipleObjectsHandler(w http.ResponseWriter,
|
||||
for index, object := range deleteObjects.Objects {
|
||||
wg.Add(1)
|
||||
go func(i int, obj ObjectIdentifier) {
|
||||
objectLock := globalNSMutex.NewNSLock(bucket, obj.ObjectName)
|
||||
objectLock.Lock()
|
||||
defer objectLock.Unlock()
|
||||
defer wg.Done()
|
||||
|
||||
dErr := objectAPI.DeleteObject(bucket, obj.ObjectName)
|
||||
if dErr != nil {
|
||||
dErrs[i] = dErr
|
||||
|
Loading…
Reference in New Issue
Block a user