Closed nayuta-gondo closed 5 years ago
lnd sometimes fails to listen.
lnd
System: Ubuntu 16.04.4 LTS x86_64
Sometimes lnd fails to listen when running tests in succession as follows("address already in use" error).
py.test -v test.py -s
It does not happen if each test is run alone as follows.
py.test -v test.py -s -k 'test_gossip[lnd_lnd]'
My guess is that the specified port is TIME_WAIT state after the previous test run.
TIME_WAIT
test.py::test_gossip[lnd_lnd] listen tcp 127.0.0.1:36332: bind: address already in use Logs: ["b'2018-08-01 08:53:33.990 [INF] LTND: Version 0.4.2-beta commit='", "b'2018-08-01 08:53:33.991 [INF] LTND: Active chain: Bitcoin (network=regtest)'", "b'2018-08-01 08:53:34.019 [INF] CHDB: Checking for schema update: latest_version=3, db_version=3'", "b'2018-08-01 08:53:34.035 [INF] LTND: Primary chain is set to: bitcoin'", "b'2018-08-01 08:53:37.857 [INF] LNWL: Opened wallet'", "b'2018-08-01 08:53:37.859 [INF] LNWL: Started listening for blocks via ZMQ on tcp://127.0.0.1:29000'", "b'2018-08-01 08:53:38.911 [INF] LNWL: The wallet has been unlocked without a time limit'", "b'2018-08-01 08:53:38.914 [INF] LNWL: Catching up block hashes to height 2323, this will take a while...'", "b'2018-08-01 08:53:38.931 [INF] LTND: LightningWallet opened'", "b'2018-08-01 08:53:38.954 [INF] HSWC: Restoring in-memory circuit state from disk'", "b'2018-08-01 08:53:38.954 [INF] HSWC: Payment circuits loaded: num_pending=0, num_open=0'", "b'2018-08-01 08:53:38.955 [INF] LNWL: Caught up to height 0'", "b'2018-08-01 08:53:38.979 [TRC] FNDG: Funding manager running'", "b'2018-08-01 08:53:38.980 [INF] RPCS: RPC server listening on 127.0.0.1:26332'", "b'2018-08-01 08:53:38.980 [ERR] LTND: gRPC proxy unable to listen on 127.0.0.1:36332'", "b'2018-08-01 08:53:38.980 [INF] FNDG: Funding manager shutting down'", "b'2018-08-01 08:53:38.980 [INF] LTND: Shutdown complete'"] FAILED
Good catch, I observed something similar and was expecting it to be related to an unclean shutdown of lnd hence I made the shutdown a bit more forceful.
lnd
sometimes fails to listen.System: Ubuntu 16.04.4 LTS x86_64
Sometimes
lnd
fails to listen when running tests in succession as follows("address already in use" error).py.test -v test.py -s
It does not happen if each test is run alone as follows.
py.test -v test.py -s -k 'test_gossip[lnd_lnd]'
My guess is that the specified port is
TIME_WAIT
state after the previous test run.