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

add handling for MalformedMessage during peer connection #1242

Merged

Conversation

pipermerriam
Copy link
Member

fixes #1241

What was wrong?

Unhandled exception when connecting to peers.

How was it fixed?

Added an except clause to handle it.

Cute Animal Picture

monkey-riding-dog2-750x741

p2p/peer.py Outdated
except MalformedMessage:
# This is kept separate from the `expected_exceptions` to be sure that we aren't
# silencing an error in our authentication code.
self.logger.info('Got malformed response from %r', remote)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should use self.logger.exception() instead as this should not happen and by doing that we'd at least have the data and the original error in the logs. Also, the comment is not accurate as this would not silence a bug in the authentication code -- it could silence a bug in our decoding of messages

Copy link
Member Author

Choose a reason for hiding this comment

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

Went with the strategy of using ERROR for this message but dumping full stacktrace in DEBUG logs.

@pipermerriam pipermerriam force-pushed the piper/handle-deserialization-error branch from 21c68e0 to 5f6557d Compare September 3, 2018 17:30
@pipermerriam pipermerriam merged commit fd5c5d4 into ethereum:master Sep 3, 2018
@pipermerriam pipermerriam deleted the piper/handle-deserialization-error branch September 3, 2018 18: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.

Exception escape during trinity run
2 participants