-
Notifications
You must be signed in to change notification settings - Fork 20.5k
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
Failing to unregister sync peer (which not registered) #22077
Comments
This is funky! I restarted a totally different machine,
|
A third machine is flipping between "is it registered or not?"
|
The type peerSet struct {
peers map[string]*peerConnection
newPeerFeed event.Feed
peerDropFeed event.Feed
lock sync.RWMutex
} Whereas teh type peerSet struct {
ethPeers map[string]*ethPeer // Peers connected on the `eth` protocol
snapPeers map[string]*snapPeer // Peers connected on the `snap` protocol The method in the
func (h *handler) removePeer(id string) {
// Remove the eth peer if it exists
eth := h.peers.ethPeer(id)
if eth != nil {
log.Debug("Removing Ethereum peer", "peer", id)
h.downloader.UnregisterPeer(id)
h.txFetcher.Drop(id)
if err := h.peers.unregisterEthPeer(id); err != nil {
log.Error("Peer removal failed", "peer", id, "err", err)
}
}
// Remove the snap peer if it exists
snap := h.peers.snapPeer(id)
if snap != nil {
log.Debug("Removing Snapshot peer", "peer", id)
h.downloader.SnapSyncer.Unregister(id)
if err := h.peers.unregisterSnapPeer(id); err != nil {
log.Error("Peer removal failed", "peer", id, "err", err)
}
} Something isn't quite right with the accounting of peers here, and the special |
Interesting.. From #22151 :
What's with that |
related #21257 |
This issue happens because If two goroutines call We can fix this by refactoring the peer unregistration a bit. At the moment, we pass the |
@fjl want to handle this? |
I'm seeing Geth 1.10.0 throw a few similar errors (after upgrading from 1.9.25)
^For the same peer, a few seconds apart. For a different peer:
The only slightly naughty thing I did was run the new |
WARN [06-03|02:38:16.714] Ancestor below allowance peer=465c4021 number=10,263,739 hash=000000..000000 allowance=10,263,739 |
The above error occurs when Generating state snapshot |
version
instance=Geth/v1.9.26-unstable-b9012a03-20201223/linux-amd64/go1.15.3
It's running latest develop,
--syncmode=snap --snapshot
. I just restarted it after having done a pruning. It keeps saying complaining about failing to unregister a peer that it for some reason thinks it's connected to, while it apparently is not.The text was updated successfully, but these errors were encountered: