Description
While working on the backup
plugin here to use the "shutdown" notification for cleanup, a questions arose: Can there be db_write
's after the "shutdown" notification?
The code below suggest it can:
lightning/lightningd/lightningd.c
Lines 1150 to 1159 in cdb93ee
The separate freeing of ld->jsonrpc
inside a db transaction was added long time ago in PR #1755 for a particular case of un-reserving the utxos (in destructor destroy_utxos
) of a fundchannel command that didn't return when the remote peer hanged.
But since v0.9.1
(PR #3867) that destructor (destroy_utxos
) is not used anymore, AFAIU utxos are now unreserved by blockheight.
Are there other destructors hanging on ld->jsonrpc
that do db transaction? If not, then PR #1755 can be reverted?
Maybe the documentation can be more explicit what plugins can expect, such as no rpc calls (e.g. datastore
) after "shutdown".