-
Notifications
You must be signed in to change notification settings - Fork 876
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
2004 reduce logging bigints #2406
2004 reduce logging bigints #2406
Conversation
I'm considering updating the DeFramer unit test to mock out the logger and check that it is called as expected in cases of valid and invalid HELLOs |
Signed-off-by: Justin Florentine <[email protected]>
…e body of the corrupt HELLO Signed-off-by: Justin Florentine <[email protected]>
Signed-off-by: Justin Florentine <[email protected]>
aecd26d
to
7dff2ad
Compare
Signed-off-by: Justin Florentine <[email protected]>
a4f9dae
to
4da65d8
Compare
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.
🚢
@@ -109,12 +109,12 @@ protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final L | |||
try { | |||
peerInfo = HelloMessage.readFrom(message).getPeerInfo(); | |||
} catch (final RLPException e) { | |||
LOG.debug("Received invalid HELLO message", e); | |||
LOG.warn("Received invalid HELLO message, set log level to TRACE for message body", e); |
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.
Are we sure that passing this log in warning does not risk spamming the logs of a node running on the mainnet or on ropsten etc ? Do we often receive invalid messages of this type ?
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.
Great point. I looked at log aggregation for all of our canaries and only see 1 occurrence of this exception. This should not result in logspam at warn instead of debug.
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.
ok 👍
* seems like a reasonable use for TRACE level instead of DEBUG * hint to user they should adjust logging if they really want to see the body of the corrupt HELLO * include actual nodeId length in error message Signed-off-by: Justin Florentine <[email protected]> Co-authored-by: Justin Florentine <[email protected]> Co-authored-by: matkt <[email protected]> Co-authored-by: garyschulte <[email protected]>
PR description
Avoids logging (potentially large) corrupt HELLO messages when connecting with peers.
Fixed Issue(s)
fixes #2004
Changelog
Failures to parse HELLO now include byte length differences on nodeId in the exception message, as well as guidance to adjust the debug level to trace if user is really interested in seeing the entire peerInfo.