-
Notifications
You must be signed in to change notification settings - Fork 2.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
server.go: replace call to removePeer with Disconnect in DisconnectPeer #6655
Conversation
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.
LGTM 🦄
What triggers the
So all these happen in a short time while the |
Also pending a release note. |
There are some call-sites (like autopilot), but probably the rpc call
Yes like a rapid reconnect. Depending on the load of ChannelLink it could take a while to come to a stop
Not sure, but if there was a running connection request, then the reconnect could be triggered by it |
Cool pending the release note otherwise LGTM🎉 |
Just needs a release notes entry and this can land! |
Without this, calls to DisconnectPeer would bypass the peerTerminationWatcher and allow subsequent connect requests to go through before the peer's links were fully shut down. This could lead to force closes.
0aec361
to
ff39f1e
Compare
added note |
Without this, calls to DisconnectPeer would bypass the peerTerminationWatcher and allow subsequent connect requests to go through before the peer's links were fully shut down. This could lead to force closes.
One way it could trigger a force close that made it look like the user lost state is:
CommitSig
and is waiting forRevokeAndAck
. The database state is persisted under the commit diff keypeer.Brontide
object receives theRevokeAndAck
and will attempt to pass it to the link.DisconnectPeer
call.removePeer
is called which removes thepeer.Brontide
object from the map without waiting for the associatedChannelLink
s to stop. This bypasses thepeerTerminationWatcher
!RevokeAndAck
to theChannelLink
- it is now in the link's mailbox.ChannelLink
isn't stopped. It will callFetchOpenChannels
when creating theChannelLink
s inloadActiveChannels
.FetchOpenChannels
does NOT include the pending remote commitment.ChannelLink
processes theRevokeAndAck
and removes the pending remote commitment all before theInit
handshake completes.Init
handshake,NewLightningChannel
is called for each channel that will result in aChannelLink
. Here NLC will fetch the pending remote commitment, which no longer exists since the existingChannelLink
removed it. The local and remote commitments are not updated here. So the remote commitment is behind by 1.ChannelLink
goes down eventually.ChannelLink
performsChannelReestablish
handshake and triggers DLP. No data is actually lost as the erroneous state is all in-memory and the correct data is on-disk.Fixes #6639
This could also trigger #6593 (though there are other ways besides using
DisconnectPeer
) and probably #6617