fix: Avoid concurrent map writes in go-routines (#5898)

Fixes #5897
This commit is contained in:
Harshavardhana
2018-05-09 11:25:38 -07:00
committed by Dee Koder
parent 2c0020e9ee
commit 98f81ced86
5 changed files with 84 additions and 52 deletions

View File

@@ -655,9 +655,9 @@ func (api objectAPIHandlers) DeleteBucketHandler(w http.ResponseWriter, r *http.
globalNotificationSys.RemoveNotification(bucket)
globalPolicySys.Remove(bucket)
for addr, err := range globalNotificationSys.DeleteBucket(bucket) {
logger.GetReqInfo(ctx).AppendTags("remotePeer", addr.Name)
logger.LogIf(ctx, err)
for _, nerr := range globalNotificationSys.DeleteBucket(bucket) {
logger.GetReqInfo(ctx).AppendTags("remotePeer", nerr.Host.Name)
logger.LogIf(ctx, nerr.Err)
}
// Write success response.