-
Notifications
You must be signed in to change notification settings - Fork 20.6k
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
eth: cancel DAO challenge on peer drop (annoying log) #2833
eth: cancel DAO challenge on peer drop (annoying log) #2833
Conversation
Updated: Tue Jul 19 09:43:07 UTC 2016 |
@@ -295,6 +295,13 @@ func (pm *ProtocolManager) handle(p *peer) error { | |||
glog.V(logger.Warn).Infof("%v: timed out DAO fork-check, dropping", p) | |||
pm.removePeer(p.id) | |||
}) | |||
// Make sure it's cleaned up if the peer dies off | |||
defer func() { | |||
if p.forkDrop != nil { |
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.
What may set this to nil
other than the line below?
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.
The reply to the challenge in:
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.
PS: They set it to nil so those parts of the code that check headers for challenges is completely disabled after the challenge passed.
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.
Could this therefor not be racey?
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.
It's all in a single thread: the defer
is in the same method that calls handleMsg
for every network packet.
The frequency in which the messages were churned out before has been halted to a minimum. I still get it occasionally but assume that it actually does timeout for those instances. |
We can hide the message completely after a while (i.e. debug log) but I'd keep it around for a bit just to see that everything behaves well. |
When peers are disconnected for some reason other than the DAO challenge (either locally or remotely), but the challenge is still running, after the 15 sec timeout a log will appear warning of a disconnect (of the already disconnected peer). Although it's fully harmless, it's annoying. This PR makes sure the challenge timer is aborted when the peer drops.