From 6eae868a95d082a522e86eb391263aa7539f3e96 Mon Sep 17 00:00:00 2001 From: cui Date: Fri, 3 Jul 2026 19:13:46 +0800 Subject: [PATCH] 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. --- p2p/discover/v5_talk.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2p/discover/v5_talk.go b/p2p/discover/v5_talk.go index dca09870d8..648e091769 100644 --- a/p2p/discover/v5_talk.go +++ b/p2p/discover/v5_talk.go @@ -102,10 +102,10 @@ func (t *talkSystem) handleRequest(id enode.ID, addr netip.AddrPort, req *v5wire }() case <-timeout.C: // Couldn't get it in time, drop the request. + t.dropCount++ if time.Since(t.lastLog) > 5*time.Second { log.Warn("Dropping TALKREQ due to overload", "ndrop", t.dropCount) t.lastLog = time.Now() - t.dropCount++ } case <-t.transport.closeCtx.Done(): // Transport closed, drop the request.