Repository navigation
Conversation
`Node::disconnect` only logged a failure to remove the peer from the peer store and then returned `Ok(())`. As `PeerStore::remove_peer` keeps the peer when its write fails, we'd keep reconnecting to a peer the caller was told had been removed, including after a restart. We now still disconnect the current session, but return the error, so the caller can retry. AI-assisted: written with help from Claude.
|
I've assigned @tnull as a reviewer! |
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.
Fixes #1210.
Node::disconnectonly logged a failure to remove the peer from the peer store and returnedOk(()), so we'd keep reconnecting to a peer the caller was told had been removed. It now still disconnects the current session, but returns the error so the caller can retry.The new test only fails writes to the peer list. For that,
NamespaceWriteFailingStorecan now be limited to a single key, likeContendedStorealready can, as the peer list shares the empty namespace with theChannelManagerand the event queue. #1149 adds a similar peer-only store, so whichever of the two lands second can reuse the other.One thing I left as is:
remove_peeralso writes when the peer isn't stored, so with a failing storedisconnectnow also returns an error for a peer that was never persisted. Avoiding that would mean changingremove_peer, which #1175 rewrites, so I kept it out of this PR.AI-assisted: written with help from Claude.