Skip to content

Prevent Electrum updates during shutdown - #1054

Open
tnull wants to merge 5 commits into
lightningdevkit:mainfrom
tnull:2026-08-electrum-shutdown-safety
Open

Prevent Electrum updates during shutdown#1054
tnull wants to merge 5 commits into
lightningdevkit:mainfrom
tnull:2026-08-electrum-shutdown-safety

Conversation

@tnull

@tnull tnull commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Based on #997 for now, will rebase once that's merged.

A timed-out synchronous Electrum sync can outlive its driving task
and continue calling Confirm implementations while node shutdown is
draining persistence work.

Close a gate before task cancellation so no new callbacks can start.
Let callbacks already in progress finish atomically before shutdown
continues.

tnull added 5 commits August 18, 2026 10:49
Avoid retaining completed Tokio task allocations for the node
lifetime while preserving shutdown cancellation and restart semantics.

Co-Authored-By: HAL 9000
Remove pending LSPS request state when callers time out or are
cancelled so unresponsive services cannot grow request maps.

Co-Authored-By: HAL 9000
Clear per-peer connection state when the leading task is cancelled
so later callers can retry and existing subscribers do not hang.

Co-Authored-By: HAL 9000
Restore wallet sync status and notify waiting callers when the task
performing a sync is cancelled, allowing later sync attempts to run.

Co-Authored-By: HAL 9000
A timed-out synchronous Electrum sync can outlive its driving task
and continue calling Confirm implementations while node shutdown is
draining persistence work.

Close a gate before task cancellation so no new callbacks can start.
Let callbacks already in progress finish atomically before shutdown
continues.

Co-Authored-By: HAL 9000
@tnull
tnull requested a review from tankyleo August 18, 2026 11:04
@ldk-reviews-bot

ldk-reviews-bot commented Aug 18, 2026

Copy link
Copy Markdown

👋 Thanks for assigning @tankyleo as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants