mirror of
https://github.com/minio/minio.git
synced 2025-01-27 06:33:18 -05:00
Merge pull request #635 from harshavardhana/pr_out_fix_a_deadlock_in_trove_when_evicting_objects_when_we_reach_the_maxsize_used
Fix a deadlock in trove when evicting objects when we reach the maxSize used
This commit is contained in:
commit
996c1a5c28
@ -127,11 +127,11 @@ func (r *Cache) Set(key string, value []byte) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// remove random key if only we reach the maxSize threshold
|
// remove random key if only we reach the maxSize threshold
|
||||||
for key := range r.items {
|
for (r.currentSize + valueLen) > r.maxSize {
|
||||||
for (r.currentSize + valueLen) > r.maxSize {
|
for key := range r.items {
|
||||||
r.doDelete(key)
|
r.doDelete(key)
|
||||||
|
break
|
||||||
}
|
}
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
r.items[key] = value
|
r.items[key] = value
|
||||||
|
Loading…
x
Reference in New Issue
Block a user