fix context deadline rejections (#13716)

This commit is contained in:
Nishant Das 2024-03-11 12:51:02 +08:00 committed by GitHub
parent 800f3b572f
commit cb8eb4e955
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -286,6 +286,11 @@ func (s *Service) wrapAndReportValidation(topic string, v wrappedVal) (string, p
return pubsub.ValidationIgnore
}
b, err := v(ctx, pid, msg)
// We do not penalize peers if we are hitting pubsub timeouts
// trying to process those messages.
if b == pubsub.ValidationReject && ctx.Err() != nil {
b = pubsub.ValidationIgnore
}
if b == pubsub.ValidationReject {
fields := logrus.Fields{
"topic": topic,