connectd: simplify logic, and add a "reconnected" message.#8570
Merged
rustyrussell merged 4 commits intoElementsProject:masterfrom Oct 1, 2025
Merged
Conversation
9e1c6a0 to
b6f525c
Compare
Changelog-Fixed: Protocol: fix occasional lost sending of final packet (usually warnings or errors). Signed-off-by: Rusty Russell <[email protected]>
b6f525c to
f96634f
Compare
One issue we have in CI is reconnection races: if an incoming connection arrives while an outgoing one is negotiated, we close the outgoing one and issue a disconnect, which fails any connect attempts. By sending a "reconnected" message instead of disconnect/connect we can avoid disturbing in-progress connection attempts which happens in CI quite a bit. Signed-off-by: Rusty Russell <[email protected]>
openingd sends an ERROR, and exits. lightningd tells us to disconnect. We read from lightningd first, and don't read from openingd. We need to drain subds when we're told to disconnect.
This can happen if we haven't transitioned to channeld yet, but logic is simply to hand it to lightningd, exactly as channeld does. ``` 2025-09-30T03:04:57.8951627Z lightningd-1 2025-09-30T02:59:14.150Z DEBUG 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-dualopend-chan#1: peer_out WIRE_WARNING 2025-09-30T03:04:57.8952126Z lightningd-1 2025-09-30T02:59:14.150Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-dualopend-chan#1: Unexpected message WIRE_ANNOUNCEMENT_SIGNATURES 2025-09-30T03:04:57.8952521Z lightningd-1 2025-09-30T02:59:14.150Z INFO 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-dualopend-chan#1: Peer connection lost 2025-09-30T03:04:57.8953124Z lightningd-1 2025-09-30T02:59:14.150Z INFO 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-chan#1: Peer transient failure in DUALOPEND_AWAITING_LOCKIN: dualopend: Owning subdaemon dualopend died (62208) ``` Signed-off-by: Rusty Russell <[email protected]>
f96634f to
4b5ac6e
Compare
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.
One issue we have in CI is reconnection races: if an incoming connection arrives while an outgoing one is negotiated, we close the outgoing one and issue a disconnect, which fails any connect attempts.
By sending a "reconnected" message instead of disconnect/connect we can avoid disturbing in-progress connection attempts which happens in CI quite a bit.
Changelog-None