doc: update shutdown notification, changelog

Fixes: #4785
Fixes: #4883

Changelog-Changed: Plugins: `shutdown` notification is now send when lightningd is almost completely shutdown, RPC calls then fail with error code -5.
This commit is contained in:
Simon Vrouwe 2021-11-24 15:16:43 +02:00 committed by Rusty Russell
parent 4dded23cd3
commit a2a480e636

View file

@ -793,12 +793,14 @@ here, with the peer's signatures attached.
### `shutdown`
Called when lightningd is shutting down, or this plugin has been
shutdown by the plugin stop command. The plugin has 30 seconds to
exit itself, otherwise it's killed.
Send in two situations: lightningd is (almost completely) shutdown, or the plugin
`stop` command has been called for this plugin. In both cases the plugin has 30
seconds to exit itself, otherwise it's killed.
Because lightningd can crash or be killed, a plugin cannot rely on
this function always called.
In the shutdown case, plugins should not interact with lightnind except via (id-less)
logging or notifications. New rpc calls will fail with error code -5 and (plugin's)
responses will be ignored. Because lightningd can crash or be killed, a plugin cannot
rely on the shutdown notification always been send.
## Hooks