Skip to content

Reconnection doesn't stop after disconnect-all-peers #611

@TheBlueMatt

Description

@TheBlueMatt

At least based on logs I got from @benthecarman, it appears ldk-node will still reconnect peers after the disconnect-all_peers call in the shutdown sequence.

His logs showed first
2025-08-13 16:52:49 INFO [ldk_node:649] Shutting down LDK Node with node ID
(immediately after which ldk-node will call PeerManager::disconnect_all_peers and expect no more peers to be connected),
then
2025-08-13 16:52:49 TRACE [lightning_background_processor:801] Terminating background processor.
(at which point having peers conneted isn't really safe in LDK cause updates to channel state won't be persisted in the ChannelManager)
followed by
2025-08-13 16:52:49 DEBUG [lightning::ln::peer_handler:1511] Finished noise handshake for connection with
(indicating the reconnection logic is still running)
and finally
2025-08-13 16:52:49 DEBUG [ldk_node:392] Stopping reconnecting known peers.

BDK then took some time (30 minutes?!) to shut down and the LSP forwarded an HTLC, resulting in
2025-08-13 17:29:48 ERROR [lightning::ln::channelmanager:13259] A ChannelManager is stale compared to the current ChannelMonitor!
on reload :(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions