Skip to content
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

downgrade hello logs to debug #2690

Merged
merged 7 commits into from
May 2, 2019
Merged

downgrade hello logs to debug #2690

merged 7 commits into from
May 2, 2019

Conversation

frrist
Copy link
Member

@frrist frrist commented Apr 30, 2019

closes #2667

@frrist frrist self-assigned this Apr 30, 2019
@frrist frrist requested a review from anorth April 30, 2019 23:09
Copy link
Member

@anorth anorth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes an immediate problem, so ship it. However, I think when we do work to separate networks more strongly (new bootstrap IPs and/or separating libp2p DHTs) then the failure here will indicate something more important.

In order to make this not completely invisible, could we follow up with metrics counting these errors? We could then observe them when desired, and the impact of other fixes.

@@ -90,11 +90,11 @@ func (h *Handler) handleNewStream(s net.Stream) {

switch err := h.processHelloMessage(from, &hello); err {
case ErrBadGenesis:
log.Warningf("genesis cid: %s does not match: %s, disconnecting from peer: %s", &hello.GenesisHash, h.genesis, from)
log.Debugf("genesis cid: %s does not match: %s, disconnecting from peer: %s", &hello.GenesisHash, h.genesis, from)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the "bad hello message" case above also disconnect?

Copy link
Member Author

@frrist frrist May 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. I believe an error for that case indicates a failure to decode the cbor message, my gut says disconnecting is the correct behaviour (it means the peer speaks the hello protocol but sent a bad message). I can add that here as well as the metics since it will be a small change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'd say it makes sense to disconnect if you send a bad hello. Not sending a hello at all should be okay though, but if youre gonna play the game, better follow the rules.

@frrist
Copy link
Member Author

frrist commented May 1, 2019

@anorth we may consider this PR as an alternative to downgrading the logs here: #2690 -- currently seeking review from the libp2p on correct usage of this.

Filed issue here: libp2p/go-libp2p#620. Will move forward with this change as is.

@frrist frrist force-pushed the fix/hello-goodbye-errors branch from c5b7322 to fb402b5 Compare May 2, 2019 19:26
@frrist frrist merged commit b2a1542 into master May 2, 2019
@frrist frrist deleted the fix/hello-goodbye-errors branch May 2, 2019 20:47
ZenGround0 pushed a commit that referenced this pull request May 3, 2019
* downgrade hello logs to debug
  * closes #2667
* disconnect on failure to read hello message
* add error count metrics to hello protocol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove unnecessary errors and warnings during hello
5 participants