-
Notifications
You must be signed in to change notification settings - Fork 20.1k
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: don't wait for snap registration if we're not running snap #22272
Conversation
eth/handler.go
Outdated
peer.Log().Error("Snapshot extension barrier failed", "err", err) | ||
return err | ||
var snapPeer *snap.Peer | ||
if peer.RunningCap(snap.ProtocolName, snap.ProtocolVersions) { |
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.
This check is not necessary here. The original code is fine, will return nil
if snap is not enabled. No need to check it here too.
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.
Ah right -- I added this first, and later changed the inner one. and didn't consider that the inner change made this moot
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.
SGTM
Build failed twice in a row on
Screw that, merge incoming |
This PR fixes a hang-on-shutdown, due to the new logic where we wait for a successful snap registration. The problem was that if we don't ourself run snap, then we'll just wait forever.
The somewhat naive fix here just adds a flag to the eth handler, to make it aware of whether the snap protocol is even enabled.
More context / logs: https://gist.github.com/holiman/22d42503cd6620fdee0baf00d6a857f3