Skip to content

graceful shutdown#9111

Open
rustyrussell wants to merge 3 commits intoElementsProject:masterfrom
rustyrussell:guilt/graceful-shutdown
Open

graceful shutdown#9111
rustyrussell wants to merge 3 commits intoElementsProject:masterfrom
rustyrussell:guilt/graceful-shutdown

Conversation

@rustyrussell
Copy link
Copy Markdown
Contributor

@rustyrussell rustyrussell commented May 5, 2026

Against #8851 which used the Andrew Morton Technique on me.

This implements graceful, which tries to make the node idle. A future variant could use this for stop if a parameter is given (probably, a timeout before giving up and stopping anyway).

Fixes: #4842
Fixes: #7697

@rustyrussell rustyrussell added this to the v26.06 milestone May 5, 2026
@rustyrussell rustyrussell requested a review from cdecker as a code owner May 5, 2026 07:04
@madelinevibes
Copy link
Copy Markdown
Collaborator

Does this PR resolve #7697 and/or #4842 ?

@rustyrussell rustyrussell force-pushed the guilt/graceful-shutdown branch 2 times, most recently from fbf292f to d69e6dd Compare May 5, 2026 10:51
@madelinevibes madelinevibes added the Status::Ready for Review The work has been completed and is now awaiting evaluation or approval. label May 5, 2026
Comment thread lightningd/peer_control.c Outdated
Copy link
Copy Markdown
Collaborator

@Lagrang3 Lagrang3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. I've learned a lot studying this PR.

@rustyrussell rustyrussell force-pushed the guilt/graceful-shutdown branch from d69e6dd to 5250df0 Compare May 7, 2026 06:24
@rustyrussell rustyrussell enabled auto-merge (rebase) May 7, 2026 06:24
@rustyrussell
Copy link
Copy Markdown
Contributor Author

Does this PR resolve #7697 and/or #4842 ?

Now it resolves BOTH!

Based on "lightningd: add "snub-idle-channels" dynamic config variable" by
Matt Whitlock <c-lightning@mattwhitlock.name>.

Fixes: ElementsProject#4842
Changelog-Added: JSON-RPC: `graceful` command to prepare CLN for shutdown.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
And use the new graceful shutdown to make it even smoother!

Fixes: ElementsProject#7697
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: contrib: the systemd lightningd.service script now shuts down lightningd properly.
@rustyrussell rustyrussell force-pushed the guilt/graceful-shutdown branch from 5250df0 to 98b5228 Compare May 7, 2026 06:50
@madelinevibes madelinevibes added PLEASE clear CI 🫠 and removed Status::Ready for Review The work has been completed and is now awaiting evaluation or approval. labels May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: Should wait for plugins to gracefully shutdown Feature request: Graceful shutdown

3 participants