liana icon indicating copy to clipboard operation
liana copied to clipboard

Handling several Liana instance w/ managed bitcoind

Open pythcoiner opened this issue 6 months ago • 0 comments

We can currently start several instance of Liana in a managed bitcoind context:

  • First instance will start bitcoind (if not already running), and will 'remember' that it should close bitcoind when closed itself.
  • Any other instance start after this one will not start bitcoind, neither close it on it self stop.

If you do so, then close the first instance, any other instance will be stuck/freeze/crash because lost connexion w/ bitcoind.

I think there is several way to handle this:

  • Detect if a Liana instance already running w/ the managed bitcoind, if so, don't allow to start a second one if it is willing to also manage the bitcoind ( I don't really like this one)
  • Notice other instances we using this bitcoind (by creating a <instance_pid>.pid in bitcoind datadir folder?) and have a 'smart' management ( only the first running instance can start bitcoind, only the last stopping can close bitcoind)

pythcoiner avatar Jan 13 '24 03:01 pythcoiner