Skip to content

No-pending-messages debug_assert is likely race-y #4437

Closed

Description

@tnull

In 47a3e5c we introduced a debug_assert checking that we don't have any pending messages in PersistenceNotifierGuard::optionally_notify. However, this seems to be race-y, as I just hit this debug_assert:

[2026-02-24T09:50:11.997Z DEBUG lightning::ln::peer_handler:1884] Finished noise handshake for connection (p:02465e)
[2026-02-24T09:50:11.998Z INFO  lightning::ln::peer_handler:2140] Received Init message: DataLossProtect: required, InitialRoutingSync: not supported, UpfrontShutdownScript: supported, GossipQueries: supported, VariableLengthOnion: required, StaticRemoteKey: required, PaymentSecret: required,
BasicMPP: supported, Wumbo: supported, AnchorsNonzeroFeeHtlcTx: not supported, AnchorsZeroFeeHtlcTx: supported, RouteBlinding: supported, ShutdownAnySegwit: supported, DualFund: not supported, Taproot: supported, Quiescence: supported, OnionMessages: supported, ProvideStorage: not supported, C
hannelType: supported, SCIDPrivacy: supported, ZeroConf: not supported, Trampoline: not supported, SimpleClose: supported, Splice: not supported, AnchorZeroFeeCommitmentsStaging: not supported, HtlcHold: not supported, unknown flags: supported (p:02465e)

thread 'tokio-runtime-worker' panicked at /home/tnull/.cargo/git/checkouts/rust-lightning-e47a539aa5104a91/b6c17c5/lightning/src/ln/channelmanager.rs:14624:7:
assertion failed: peer_state.pending_msg_events.is_empty()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted

Activity

  1. TheBlueMatt commented on Mar 2, 2026

    @TheBlueMatt
    Collaborator

    Do you know/can you repro to find out which message was pending when you hit this?

  2. added this to the 0.3 milestone on Mar 2, 2026
  3. added 2 commits that reference this issue on Mar 24, 2026
    fb7875f
    6da89c2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions