json-rpc: Shutdown the JSON-RPC in the context of a DB transaction

This needs to be done separately from the rest of the daemon since we can
otherwise not make sure that it happens before the DB is freed and we might
still need the DN, and be running in a DB transaction, for some destructors to
run.
This commit is contained in:
Christian Decker
2018-07-24 22:32:58 +02:00
parent ead0c8e17a
commit d6048de100
4 changed files with 20 additions and 8 deletions

View File

@@ -1,7 +1,6 @@
from fixtures import * # noqa: F401,F403
import os
import pytest
import signal
import unittest
@@ -11,13 +10,13 @@ with open('config.vars') as configfile:
DEVELOPER = os.getenv("DEVELOPER", config['DEVELOPER']) == "1"
@pytest.mark.xfail(strict=True)
@unittest.skipIf(not DEVELOPER, "needs --dev-disconnect")
def test_stop_pending_fundchannel(node_factory, executor):
"""Stop the daemon while waiting for an accept_channel
This used to crash the node, since we were calling unreserve_utxo while freeing
the daemon, but that needs a DB transaction to be open.
This used to crash the node, since we were calling unreserve_utxo while
freeing the daemon, but that needs a DB transaction to be open.
"""
l1 = node_factory.get_node()
l2 = node_factory.get_node()