Skip to content

lightningd: wait for all plugins to gracefully shutdown#9000

Open
ThomsenDrake wants to merge 1 commit intoElementsProject:masterfrom
ThomsenDrake:fix/plugin-graceful-shutdown-7697
Open

lightningd: wait for all plugins to gracefully shutdown#9000
ThomsenDrake wants to merge 1 commit intoElementsProject:masterfrom
ThomsenDrake:fix/plugin-graceful-shutdown-7697

Conversation

@ThomsenDrake
Copy link
Copy Markdown

Fixes #7697

When multiple plugins are shutting down and one exits before others,
io_loop() can return early (e.g. when num_fds drops to 0), causing
remaining plugins to be killed immediately instead of being given their
full 30-second grace period.

Fix by wrapping io_loop() in a while loop that continues as long as
plugins are still alive, only breaking when the timer expires.

The fix is minimal (7 lines changed) and follows the existing code
pattern. No new state tracking needed — the plugin list already
correctly tracks which plugins are alive.

When multiple plugins are shutting down and one exits before others,
io_loop() can return early (e.g. when num_fds drops to 0), causing
remaining plugins to be killed immediately instead of being given their
full 30-second grace period.

Fix by wrapping io_loop() in a while loop that continues as long as
plugins are still alive, only breaking when the timer expires.

Fixes ElementsProject#7697

Changelog-Fixed: Plugins: now wait for all plugins to gracefully shutdown instead of killing remaining plugins when one exits first. ([ElementsProject#7697])
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.

feature: Should wait for plugins to gracefully shutdown

1 participant