[#283] pool: Fix incErrorRate
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
0b8c53ebc9
commit
58fe1768cc
1 changed files with 4 additions and 4 deletions
|
@ -558,6 +558,10 @@ func (c *clientStatusMonitor) address() string {
|
|||
func (c *clientStatusMonitor) incErrorRate() {
|
||||
c.currentErrorCount.Inc()
|
||||
c.overallErrorCount.Inc()
|
||||
if c.currentErrorCount.Load() >= c.errorThreshold {
|
||||
c.setHealthy(false)
|
||||
c.resetErrorCounter()
|
||||
}
|
||||
}
|
||||
|
||||
func (c *clientStatusMonitor) currentErrorRate() uint32 {
|
||||
|
@ -601,10 +605,6 @@ func (c *clientStatusMonitor) handleError(st apistatus.Status, err error) error
|
|||
apistatus.WrongMagicNumber, *apistatus.WrongMagicNumber,
|
||||
apistatus.SignatureVerification, *apistatus.SignatureVerification:
|
||||
c.incErrorRate()
|
||||
if c.currentErrorRate() >= c.errorThreshold {
|
||||
c.setHealthy(false)
|
||||
c.resetErrorCounter()
|
||||
}
|
||||
}
|
||||
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue