distinguish throttled validation because of a full worker queue.

This commit is contained in:
vyzo 2020-03-16 18:24:37 +02:00
parent 06d72b93da
commit 98671566a2
2 changed files with 8 additions and 2 deletions

View File

@ -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))

View File

@ -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
}