mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 10:20:44 +00:00
p2p/discover: always increment TALKREQ drop counter on timeout (#35243)
Increment `dropCount` on every TALKREQ dropped due to overload timeout. Previously the counter was only updated when the throttled warning log was emitted.
This commit is contained in:
parent
3006c4411b
commit
6eae868a95
1 changed files with 1 additions and 1 deletions
|
|
@ -102,10 +102,10 @@ func (t *talkSystem) handleRequest(id enode.ID, addr netip.AddrPort, req *v5wire
|
||||||
}()
|
}()
|
||||||
case <-timeout.C:
|
case <-timeout.C:
|
||||||
// Couldn't get it in time, drop the request.
|
// Couldn't get it in time, drop the request.
|
||||||
|
t.dropCount++
|
||||||
if time.Since(t.lastLog) > 5*time.Second {
|
if time.Since(t.lastLog) > 5*time.Second {
|
||||||
log.Warn("Dropping TALKREQ due to overload", "ndrop", t.dropCount)
|
log.Warn("Dropping TALKREQ due to overload", "ndrop", t.dropCount)
|
||||||
t.lastLog = time.Now()
|
t.lastLog = time.Now()
|
||||||
t.dropCount++
|
|
||||||
}
|
}
|
||||||
case <-t.transport.closeCtx.Done():
|
case <-t.transport.closeCtx.Done():
|
||||||
// Transport closed, drop the request.
|
// Transport closed, drop the request.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue