Skip to content

bug: a stopped node's last event can be delivered twice after a restart #1397

Open

Description

@ovitrif

LightningService.stop() cancels the event loop by clearing node, then returns without waiting for the loop. A loop that is mid-iteration finishes it after stop() returned, possibly blocked in node.eventHandled() (which persists the event queue) or in the MainActor hop of event delivery.

restart() then builds the next node on the same storage. If the old node's queue write has not landed, the new node can load a queue that still holds the event and deliver it again, or the late write can overwrite the new node's queue.

The window is narrow (an event dequeued while node.stop() runs) and predates the polling loop in a wider form.

Expected: no work of the stopped node's event loop overlaps the next node's setup(). Waiting for the loop in stop() needs a bound, since eventHandled() can block on a stuck VSS write.

Raised in #1395 (review).

Activity

  1. added this to the 3.2.0 milestone on Nov 23, 2026
  2. self-assigned this
    on Nov 23, 2026
  3. added theissue type on Nov 23, 2026
  4. modified the milestones: 3.2.0, 3.3.0 on Nov 25, 2026
  5. ovitrif commented on Nov 25, 2026

    @ovitrif
    CollaboratorAuthor

    Triage: moved to the 3.3.0 milestone. 3.2.0 now holds only the Spark release work and nearby payments (NFC and Bluetooth).

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

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions