-
Notifications
You must be signed in to change notification settings - Fork 912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cln_plugin: multiple triggers for plugin shutdown #6040
Comments
I think these are very much distinct: the The |
What's the difference between cleaning up resources on The only benefit of Edit: looks like we can't do RPC with lightningd once we've received |
According to the docs the RPC is also no longer present:
This means the two are pretty much identical, and Being a courtesy notification, we cannot ensure it will always be delivered (if the |
Thanks for explaining. With #6041 we can just call |
When plugins receive a "shutdown" notification, then can call this method which will shutdown `cln_plugin`. Then they can await `plugin.join()` and do any remaining cleanup there. This helps avoid a pain-point where plugin authors need to handle 2 separate plugin shutdown mechanisms #6040
When plugins receive a "shutdown" notification, then can call this method which will shutdown `cln_plugin`. Then they can await `plugin.join()` and do any remaining cleanup there. This helps avoid a pain-point where plugin authors need to handle 2 separate plugin shutdown mechanisms ElementsProject#6040
When plugins receive a "shutdown" notification, then can call this method which will shutdown `cln_plugin`. Then they can await `plugin.join()` and do any remaining cleanup there. This helps avoid a pain-point where plugin authors need to handle 2 separate plugin shutdown mechanisms ElementsProject#6040
When plugins receive a "shutdown" notification, then can call this method which will shutdown `cln_plugin`. Then they can await `plugin.join()` and do any remaining cleanup there. This helps avoid a pain-point where plugin authors need to handle 2 separate plugin shutdown mechanisms ElementsProject#6040
When plugins receive a "shutdown" notification, then can call this method which will shutdown `cln_plugin`. Then they can await `plugin.join()` and do any remaining cleanup there. This helps avoid a pain-point where plugin authors need to handle 2 separate plugin shutdown mechanisms ElementsProject#6040
As far as I can tell, plugin authors need to handle 2 separate triggers to shut down our plugins:
lightnignd
.lightningd
stopped and we didn't receiveshutdown
notification. This can be if we read from STDIN and receive 0 bytes.Having to handle 2 different shutdown triggers complicate plugin code. Ideally plugin authors could pass a single callback to
cln_plugin
's plugin builder which would get run in either case. It also took me a long time to understand that I should be handling these 2 cases. Perhaps one explicit shutdown handler would make this clearer. If, for some reason, a plugin wanted to handle these differently, then an enum could be passed as an argument to this callback indicating which case needs handling.The text was updated successfully, but these errors were encountered: