From 98671566a24382793fac75c8ad2088b1ad2afc24 Mon Sep 17 00:00:00 2001 From: vyzo Date: Mon, 16 Mar 2020 18:24:37 +0200 Subject: [PATCH] distinguish throttled validation because of a full worker queue. --- score.go | 6 ++++++ validation.go | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/score.go b/score.go index 576eebe..a16732a 100644 --- a/score.go +++ b/score.go @@ -607,6 +607,12 @@ func (ps *peerScore) RejectMessage(msg *Message, reason string) { fallthrough case "blacklisted source": return + + case "validation queue full": + // the message was rejected before it entered the validation pipeline; + // we don't know if this message has a valid signature, and thus we also don't know if + // it has a valid message ID; all we can do is ignore it. + return } drec := ps.deliveries.getRecord(ps.msgID(msg.Message)) diff --git a/validation.go b/validation.go index fb18b38..96e8be0 100644 --- a/validation.go +++ b/validation.go @@ -151,8 +151,8 @@ func (v *validation) Push(src peer.ID, msg *Message) bool { select { case v.validateQ <- &validateReq{vals, src, msg}: default: - log.Warningf("message validation throttled; dropping message from %s", src) - v.tracer.RejectMessage(msg, "validation throttled") + log.Warningf("message validation throttled: queue full; dropping message from %s", src) + v.tracer.RejectMessage(msg, "validation queue full") } return false }