eth: don't wait for snap registration if we're not running snap#22272
Merged
Conversation
karalabe
reviewed
Feb 5, 2021
| peer.Log().Error("Snapshot extension barrier failed", "err", err) | ||
| return err | ||
| var snapPeer *snap.Peer | ||
| if peer.RunningCap(snap.ProtocolName, snap.ProtocolVersions) { |
Member
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
Ah right -- I added this first, and later changed the inner one. and didn't consider that the inner change made this moot
Contributor
Author
|
Build failed twice in a row on Screw that, merge incoming |
This was referenced Mar 9, 2021
9 tasks
9 tasks
This was referenced Sep 23, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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