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

[swarm] Log connection close in swarm. Simplify some bounds. #1393

Merged
merged 2 commits into from
Jan 16, 2020

Conversation

romanb
Copy link
Contributor

@romanb romanb commented Jan 15, 2020

This is just a small PR that:

  1. Adds logging for NodeClosed events, as otherwise the contained error is forever lost. I chose trace level for, but I guess debug would be ok, too. This is primarily useful when troubleshooting connection issues.
  2. Simplifies some trait bounds.

Copy link
Member

@tomaka tomaka left a comment

Choose a reason for hiding this comment

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

Maybe we should pass the error in SwarmEvent::Disconnected

@romanb
Copy link
Contributor Author

romanb commented Jan 16, 2020

Maybe we should pass the error in SwarmEvent::Disconnected

I thought about it, but went with logging to start with as the least intrusive option (i.e. no API changes). I can follow up with another PR that proposes the change to the event.

@tomaka
Copy link
Member

tomaka commented Jan 16, 2020

I'd go with the API change. This can be either in this PR or a different one.

@romanb romanb merged commit c241014 into libp2p:master Jan 16, 2020
@romanb romanb deleted the log-conn-closed branch January 16, 2020 12:17
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.

2 participants