Skip to content

cln_plugin: multiple triggers for plugin shutdown #6040

Closed
@justinmoon

Description

@justinmoon

As far as I can tell, plugin authors need to handle 2 separate triggers to shut down our plugins:

  1. We receive shutdown notification from lightnignd.
  2. lightningd stopped and we didn't receive shutdown 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.

Metadata

Metadata

Assignees

Labels

rustIssue related to rust

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions