types/logger: fix deadlock in the burst case.

Fixes #365.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson
2020-05-09 02:52:03 +00:00
parent ccbd0937d0
commit 48b1e85e8a
2 changed files with 4 additions and 3 deletions

View File

@@ -72,7 +72,6 @@ func RateLimitedFn(logf Logf, f float64, b int, m int) Logf {
if ok {
msgCache.MoveToFront(rl.ele)
if rl.lim.Allow() {
mu.Lock()
rl.msgBlocked = false
mu.Unlock()
logf(format, args...)