forked from TrueCloudLab/frostfs-node
[#92] Ensure policer objects cannot be worked on concurrently
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
This commit is contained in:
parent
3223402c90
commit
26acf5689e
2 changed files with 8 additions and 7 deletions
|
@ -51,12 +51,11 @@ func (p *Policer) shardPolicyWorker(ctx context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
p.objsInWork.add(addr.Address)
|
||||
|
||||
p.processObject(ctx, addr)
|
||||
|
||||
p.cache.Add(addr.Address, time.Now())
|
||||
p.objsInWork.remove(addr.Address)
|
||||
if p.objsInWork.add(addr.Address) {
|
||||
p.processObject(ctx, addr)
|
||||
p.cache.Add(addr.Address, time.Now())
|
||||
p.objsInWork.remove(addr.Address)
|
||||
}
|
||||
})
|
||||
if err != nil {
|
||||
p.log.Warn(logs.PolicerPoolSubmission, zap.Error(err))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue