Skip to content
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

build: create v0.17.1 rc3 release branch #8162

Merged

Conversation

Roasbeef
Copy link
Member

@Roasbeef Roasbeef commented Nov 8, 2023

Includes a bug fix for a potential deadlock in the peer handling logic.

Crypt-iQ and others added 4 commits November 8, 2023 14:58
Without this the following could happen:

* InboundPeerConnected is called while we already have an inbound
connection with the peer. This calls removePeer which calls Disconnect.
* If the peer is starting up in Start, it may be sending messages
synchronously via SendMessage(true, ...). This eventually calls the
writeMessage function which will exit if disconnect is set to 1.
* Since Disconnect was called, disconnect will be 1 and writeMessage
will exit, causing writeHandler to exit.
* If there is more than 1 message being sent, later messages will
queue in queueHandler but be unable to get into sendQueue as the
writeHandler goroutine has exited.
* The synchronous sends will be waiting on the errChan indefinitely
and startReady will never get closed meaning Disconnect will never
proceed.

The end result is that the server's mutex will be held until shutdown.

Avoid this by using writeMessage to bypass the writeHandler goroutine.
@Roasbeef Roasbeef changed the title build: create v0.17.1 rc2 release branch build: create v0.17.1 rc3 release branch Nov 9, 2023
@Roasbeef Roasbeef merged commit eea15f0 into lightningnetwork:v0-17-1-branch-rc3 Nov 9, 2023
20 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants