-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make message large message handling robust and noisy #189
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -342,15 +342,25 @@ func (gs *GossipSubRouter) sendRPC(p peer.ID, out *RPC) { | |
return | ||
} | ||
|
||
select { | ||
case mch <- out: | ||
default: | ||
log.Infof("dropping message to peer %s: queue full", p) | ||
// push control messages that need to be retried | ||
ctl := out.GetControl() | ||
if ctl != nil { | ||
gs.pushControl(p, ctl) | ||
if out.Size() > maxRPCSize { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here too, this check seems unnecessary. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm worried we could add too much gossip. That's why I have that check. But I can remove it if you think it's overkill. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, this check is reasonable on second thought, if we are adding too much gossip (over 64KB) we probably want to know. |
||
log.Errorf( | ||
"dropping RPC outbound message that's too large: %d > %d", | ||
out.Size(), | ||
maxRPCSize, | ||
) | ||
} else { | ||
select { | ||
case mch <- out: | ||
return | ||
default: | ||
} | ||
log.Infof("dropping message to peer %s: queue full", p) | ||
} | ||
|
||
// push control messages that need to be retried | ||
ctl = out.GetControl() | ||
if ctl != nil { | ||
gs.pushControl(p, ctl) | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this check really necessary here?
We already drop large messages on publish and can't read messages larger than maxRCPSize anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it should be fine in floodsub. My worry is gossipsub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, let's remove it from here as it's redundant, and rethink the gossipsub case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can't hurt and future proofs us against, e.g., batching too many messages in a single RPC and then silently failing when the remote side drops it.