lbryio / hub

MIT License
16 stars 15 forks source link

test_connection_drop_still_receives_events_after_reconnected: reconnect to herald appears to happen, but send_to_address_and_wait() hangs. #98

Closed moodyjon closed 2 years ago

moodyjon commented 2 years ago

I observed this happen with some extra logging hacked into moodyjon/lbry-sdk. Client is able to reconnect to herald, and get RPC responses ("blockchain.address.subscribe", "ping"). But all is not well because send_to_address_and_wait() appears to hang.

https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true

test_connection_drop_still_receives_events_after_reconnected (integration.blockchain.test_network.ReconnectTests) ... 2022-09-10 02:44:22,151 - asyncio - WARNING - Executing <Task pending coro=<IntegrationTestCase.asyncSetUp() running at /home/runner/work/lbry-sdk/lbry-sdk/lbry/testcase.py:252> wait_for=<Future pending cb=[_chain_future.<locals>._call_check_cancel() at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/futures.py:351, <TaskWakeupMethWrapper object at 0x7f23301d4150>()] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:395> cb=[_run_until_complete_cb() at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:157] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:566> took 0.415 seconds
[129](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:130)
2022-09-10 02:44:23,137 - elasticsearch - WARNING - GET http://localhost:9200/_template/da672948ab6f41dbba42287a0c74e2b8claims [status:404 request:0.003s]
[130](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:131)
2022-09-10 02:44:24,143 - lbry.wallet.network - WARNING - wait reconnect+keepalive
[131](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:132)
2022-09-10 02:44:24,399 - lbry.wallet.network - WARNING - <bound method Network.resolve of <lbry.wallet.network.Network object at 0x7f233018a310>>: Wallet server unavailable, waiting for it to come back and retry.
[132](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:133)
2022-09-10 02:44:24,400 - lbry.wallet.network - DEBUG - Connection lost: localhost:50002
[133](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:134)
2022-09-10 02:44:24,401 - lbry.wallet.network - INFO - closing connection to localhost:50002
[134](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:135)
2022-09-10 02:44:24,401 - lbry.wallet.network - WARNING - urgent reconnect needed
[135](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:136)
2022-09-10 02:44:24,401 - lbry.wallet.network - INFO - connection lost to localhost:50002
[136](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:137)
2022-09-10 02:44:24,404 - lbry.wallet.network - INFO - 1 possible spv servers to try (1 urls in config)
[137](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:138)
2022-09-10 02:44:24,407 - lbry.wallet.network - INFO - localhost:50002 has latency of 0.89ms (available: True, height: 200)
[138](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:139)
2022-09-10 02:44:24,408 - lbry.wallet.udp - INFO - closed udp spv server selection client
[139](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:140)
2022-09-10 02:44:24,413 - lbry.wallet.network - INFO - Connected to spv server localhost:50002
[140](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:141)
2022-09-10 02:44:24,414 - lbry.wallet.network - DEBUG - send server.version('0.110.0', '0.110.0') to localhost:50002 (30 timeout)
[141](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:142)
2022-09-10 02:44:24,414 - lbry.wallet.network - DEBUG - send version request to localhost:50002
[142](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:143)
2022-09-10 02:44:24,418 - lbry.wallet.network - DEBUG - get spv server features localhost:50002
[143](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:144)
2022-09-10 02:44:24,418 - lbry.wallet.network - DEBUG - send server.features() to localhost:50002 (30 timeout)
[144](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:145)
2022-09-10 02:44:24,421 - lbry.wallet.network - DEBUG - response server.features() from localhost:50002 (30 timeout) -> {'hosts': {}, 'pruning': None, 'server_version': '0.107.0', 'protocol_min': '0.54.0', 'protocol_max': '0.199.0', 'genesis_hash': '6e3fcf1299d4ec5d79c3a4c91d624a4acf9e2e173d95a1a0504f677669687556', 'description': '', 'payment_address': '', 'donation_address': '', 'daily_fee': '0', 'hash_function': 'sha256', 'trending_algorithm': 'fast_ar'}
[145](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:146)
2022-09-10 02:44:24,421 - lbry.wallet.network - DEBUG - discover other hubs localhost:50002
[146](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:147)
2022-09-10 02:44:24,421 - lbry.wallet.network - DEBUG - send server.peers.subscribe() to localhost:50002 (30 timeout)
[147](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:148)
2022-09-10 02:44:24,425 - lbry.wallet.network - DEBUG - response server.peers.subscribe() from localhost:50002 (30 timeout) -> []
[148](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:149)
2022-09-10 02:44:24,425 - lbry.wallet.network - INFO - subscribe to headers localhost:50002
[149](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:150)
2022-09-10 02:44:24,425 - lbry.wallet.network - DEBUG - send blockchain.headers.subscribe(True,) to localhost:50002 (30 timeout)
[150](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:151)
2022-09-10 02:44:24,432 - lbry.wallet.network - DEBUG - response blockchain.headers.subscribe(True,) from localhost:50002 (30 timeout) -> {'hex': '00000030f698d125adf35c5f5cb1f8e0fa6345941b918c96165c5b367a75af78f2e4948e375fc6af19bd0559ead304a779698b64036544fba9c6ac315a031c9ac3e0fb57010000000000000000000000000000000000000000000000000000000000000026fa1b63ffff7f2003000000', 'height': 200}
[151](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:152)
2022-09-10 02:44:24,433 - lbry.wallet.network - INFO - maintaining connection to spv server localhost:50002
[152](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:153)
2022-09-10 02:44:24,433 - lbry.wallet.network - WARNING - wait reconnect+keepalive
[153](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:154)
2022-09-10 02:44:24,434 - lbry.wallet.network - WARNING - <bound method Network.resolve of <lbry.wallet.network.Network object at 0x7f233018a310>>: Wallet server available, proceeding.
[154](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:155)
2022-09-10 02:44:24,434 - lbry.wallet.network - DEBUG - send blockchain.claimtrie.resolve('derp',) to localhost:50002 (30 timeout)
[155](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:156)
2022-09-10 02:44:24,437 - lbry.wallet.ledger - INFO - Subscribing and updating accounts.
[156](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:157)
2022-09-10 02:44:24,437 - lbry.wallet.ledger - INFO - Subscribe to 1 accounts
[157](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:158)
2022-09-10 02:44:24,446 - lbry.wallet.network - DEBUG - send blockchain.address.subscribe('mhPwtdg9F3YDhQ73cTpcZUdu8AePzJuxkv', 'mwPZjV9EmEc2tJTmQgT3JHSHd8zzRQ2emv', 'mm7vpWDLY6HKbhvDx3kViLeHmgBzb24bYK', 'mwo3Yr1ZMyfKBSXECLrF6SUNV6mFq7R155', 'mqZdjLZgpQtF4yHVKrJ2bwW4uELKwW7Hzb', 'mwoUQ1FbWHgyrAWsx6xgWsXej51SbDwLZt', 'n2QCLbv5VrBL47cjjnpzh3e5T1VVHRswwg', 'mfzDng8JjyfiVxD75k3aKEER6WGeJ98FHa', 'mmcYB6vxvYsSokCeVEnsqxsHLx1M9iAbaP', 'miW5XRRBQFqc5f5dbvugdqg8qnvLUeNq7c', 'mncN8oUaK19nAyunbb7tKR9HGEkvwoRQUs', 'mwvSfTxX6YmED2ER1op3AGf1kaCSuKWxfG', 'mk6WYEYUsUbVNag3YUAGnFSrbocZ41vPd1', 'mwtVJfSrhhJchHxhHsUqCjC2YkgzZatQYE', 'mzsQRfBJJwjsroE93F4egbEbuXaLLh5jem', 'n2N9AMawai4PsVWD9sJ6Z8S3B5Tso2AsTe', 'mgPyTzLDF9gEAwRooPV5ECspJSX9adXESi', 'mmaPfYKJ1EZkUSvvS9xVM6bfZ2sEMqfCEt', 'mjyszN7oucgvKoSWzux9hJo9HRFgHc9ce8', 'mtjSsNv9Ag3enCpkvF2tGV4yqz2hwicSyH') to localhost:50002 (30 timeout)
[158](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:159)
2022-09-10 02:44:24,449 - lbry.wallet.network - DEBUG - response blockchain.claimtrie.resolve('derp',) from localhost:50002 (30 timeout) -> CiV6IwgBEh9Db3VsZCBub3QgZmluZCBjbGFpbSBhdCAiZGVycCIu
[159](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:160)
2022-09-10 02:44:24,450 - lbry.wallet.orchstr8.node.lbcwallet - INFO - /home/runner/work/lbry-sdk/lbry-sdk/lbry/wallet/bin/lbcctl --rpcuser=rpcuser --rpcpass=rpcpassword --notls --regtest --wallet sendtoaddress mwo3Yr1ZMyfKBSXECLrF6SUNV6mFq7R155 1.1337
[160](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:161)
2022-09-10 02:44:24,501 - lbry.wallet.orchstr8.node.lbcwallet - INFO - 2022-09-10 02:44:24.499 [INF] TMGR: Inserting unconfirmed transaction 6914b06c368bbe98a4393d44dbda13b455e3a194d6a5066e0ed0728022e845ba
[161](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:162)

[162](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:163)
2022-09-10 02:44:24,503 - lbry.wallet.orchstr8.node.lbcwallet - INFO - 2022-09-10 02:44:24.503 [INF] RPCS: Successfully sent transaction 6914b06c368bbe98a4393d44dbda13b455e3a194d6a5066e0ed0728022e845ba
[163](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:164)

[164](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:165)
2022-09-10 02:44:24,508 - lbry.wallet.orchstr8.node.lbcwallet - INFO - 6914b06c368bbe98a4393d44dbda13b455e3a194d6a5066e0ed0728022e845ba
[165](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:166)
2022-09-10 02:44:24,614 - lbry.wallet.network - DEBUG - response blockchain.address.subscribe('mhPwtdg9F3YDhQ73cTpcZUdu8AePzJuxkv', 'mwPZjV9EmEc2tJTmQgT3JHSHd8zzRQ2emv', 'mm7vpWDLY6HKbhvDx3kViLeHmgBzb24bYK', 'mwo3Yr1ZMyfKBSXECLrF6SUNV6mFq7R155', 'mqZdjLZgpQtF4yHVKrJ2bwW4uELKwW7Hzb', 'mwoUQ1FbWHgyrAWsx6xgWsXej51SbDwLZt', 'n2QCLbv5VrBL47cjjnpzh3e5T1VVHRswwg', 'mfzDng8JjyfiVxD75k3aKEER6WGeJ98FHa', 'mmcYB6vxvYsSokCeVEnsqxsHLx1M9iAbaP', 'miW5XRRBQFqc5f5dbvugdqg8qnvLUeNq7c', 'mncN8oUaK19nAyunbb7tKR9HGEkvwoRQUs', 'mwvSfTxX6YmED2ER1op3AGf1kaCSuKWxfG', 'mk6WYEYUsUbVNag3YUAGnFSrbocZ41vPd1', 'mwtVJfSrhhJchHxhHsUqCjC2YkgzZatQYE', 'mzsQRfBJJwjsroE93F4egbEbuXaLLh5jem', 'n2N9AMawai4PsVWD9sJ6Z8S3B5Tso2AsTe', 'mgPyTzLDF9gEAwRooPV5ECspJSX9adXESi', 'mmaPfYKJ1EZkUSvvS9xVM6bfZ2sEMqfCEt', 'mjyszN7oucgvKoSWzux9hJo9HRFgHc9ce8', 'mtjSsNv9Ag3enCpkvF2tGV4yqz2hwicSyH') from localhost:50002 (30 timeout) -> [None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None]
[166](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:167)
2022-09-10 02:44:24,621 - lbry.wallet.ledger - INFO - subscribed to 20/20 addresses on 127.0.0.1:50002
[167](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:168)
2022-09-10 02:44:24,621 - lbry.wallet.ledger - INFO - finished subscribing to 20 addresses on 127.0.0.1:50002
[168](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:169)
2022-09-10 02:44:24,630 - lbry.wallet.network - DEBUG - send blockchain.address.subscribe('mxLiE7YHrAAyCcLW39eS8hjq4vFbpcxYCY', 'mxkmekdab8WY5DfL78NfsvRsaHhGRihf8j', 'mzMDw5swRmF5VPDrimaPwuNSQj8kFQb2c6', 'mrdsR5N4aqLMGrBjSxe4eeES8i2xYuKYMu', 'mjjnGPjWiVAJiMmUsgoPqYn4NzQQrG37X7', 'mvaGfg6ShJ4m55vu1c66JtDA6s1vzoTSGU') to localhost:50002 (30 timeout)
[169](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:170)
2022-09-10 02:44:24,648 - lbry.wallet.network - DEBUG - response blockchain.address.subscribe('mxLiE7YHrAAyCcLW39eS8hjq4vFbpcxYCY', 'mxkmekdab8WY5DfL78NfsvRsaHhGRihf8j', 'mzMDw5swRmF5VPDrimaPwuNSQj8kFQb2c6', 'mrdsR5N4aqLMGrBjSxe4eeES8i2xYuKYMu', 'mjjnGPjWiVAJiMmUsgoPqYn4NzQQrG37X7', 'mvaGfg6ShJ4m55vu1c66JtDA6s1vzoTSGU') from localhost:50002 (30 timeout) -> [None, None, None, None, None, None]
[170](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:171)
2022-09-10 02:44:24,650 - lbry.wallet.ledger - INFO - subscribed to 6/6 addresses on 127.0.0.1:50002
[171](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:172)
2022-09-10 02:44:24,650 - lbry.wallet.ledger - INFO - finished subscribing to 6 addresses on 127.0.0.1:50002
[172](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:173)
2022-09-10 02:44:56,567 - lbry.wallet.orchstr8.node.lbcd - INFO - 2022-09-10 02:44:56.566 [INF] MAIN: RAM: using 0.0 GB with 4.2 available, DISK: using 0.0 GB with 30.3 available
[173](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:174)

[174](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:175)
2022-09-10 02:45:24,633 - lbry.wallet.network - DEBUG - send server.ping() to localhost:50002 (30 timeout)
[175](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:176)
2022-09-10 02:45:24,640 - lbry.wallet.network - DEBUG - response server.ping() from localhost:50002 (30 timeout) -> None

Hang here. No further activity until asyncio’s task dump.

[176](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:177)
Stack for <Task pending coro=<Network.network_loop() running at /home/runner/work/lbry-sdk/lbry-sdk/lbry/wallet/network.py:351> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f2333f78c10>()] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:395> cb=[Network.start.<locals>.loop_task_done_callback() at /home/runner/work/lbry-sdk/lbry-sdk/lbry/wallet/network.py:222] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/tasks.py:351> (most recent call last):
[177](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:178)
Stack for <Task pending coro=<ElasticNotifierClientProtocol.maintain_connection() running at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/notifier_protocol.py:54> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f232af88cd0>()] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:395> created at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/service.py:58> (most recent call last):
[178](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:179)
Stack for <Task pending coro=<BlockchainProcessorService.process_blocks_and_mempool_forever() running at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/scribe/service.py:1684> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f2330556550>()] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:395> created at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/service.py:58> (most recent call last):
[179](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:180)
Stack for <Task pending coro=<LBRYElectrumX._receive_messages() running at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/herald/session.py:1030> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f233055c0d0>()] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:395> created at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/herald/session.py:834> (most recent call last):
[180](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:181)
Stack for <Task pending coro=<HubServerService.receive_es_notifications() running at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/herald/service.py:110> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f2330602b90>()] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:395> created at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/service.py:58> (most recent call last):
[181](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:182)
Stack for <Task pending coro=<Prefetcher.main_loop() running at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/scribe/prefetcher.py:47> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f233020b0d0>()] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:395> created at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/service.py:58> (most recent call last):
[182](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:183)
Stack for <Task pending coro=<HubMemPool.send_notifications_forever() running at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/herald/mempool.py:236> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f2330638890>()] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:395> created at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/service.py:58> (most recent call last):
[183](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:184)
Stack for <Task pending coro=<Event.wait() running at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/locks.py:293> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f2330427350>()] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:395> cb=[_wait.<locals>._on_completion() at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/tasks.py:466] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/tasks.py:387> (most recent call last):
[184](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:185)
Stack for <Task pending coro=<ClientSession.keepalive_loop() running at /home/runner/work/lbry-sdk/lbry-sdk/lbry/wallet/network.py:127> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f23304a58d0>()] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:395> cb=[_wait.<locals>._on_completion() at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/tasks.py:466] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/tasks.py:351> (most recent call last):
[185](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:186)
Stack for <Task pending coro=<SessionManager._manage_servers() running at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/herald/session.py:303> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f23301224d0>()] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:395> cb=[_wait.<locals>._on_completion() at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/tasks.py:466] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/tasks.py:387> (most recent call last):
[186](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:187)
Stack for <Task pending coro=<SessionManager._clear_stale_sessions() running at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/herald/session.py:357> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f2334892dd0>()] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:395> cb=[_wait.<locals>._on_completion() at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/tasks.py:466] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/tasks.py:387> (most recent call last):
[187](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:188)
Stack for <Task pending coro=<BlockchainReaderService.refresh_blocks_forever() running at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/service.py:252> wait_for=<Future pending cb=[_chain_future.<locals>._call_check_cancel() at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/futures.py:351, <TaskWakeupMethWrapper object at 0x7f2328f4d690>()] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:395> created at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/service.py:58> (most recent call last):
[188](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:189)
Stack for <Task pending coro=<ReconnectTests.test_connection_drop_still_receives_events_after_reconnected() running at /home/runner/work/lbry-sdk/lbry-sdk/tests/integration/blockchain/test_network.py:130> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f2328eb5ad0>()] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:395> cb=[_run_until_complete_cb() at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:157] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:566> (most recent call last):
[189](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:190)
Stack for <Task pending coro=<ElasticSyncService.run_es_notifier() running at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/elastic_sync/service.py:65> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f23348fdfd0>()] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:395> created at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/service.py:58> (most recent call last):
[190](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:191)
Stack for <Task pending coro=<Event.wait() running at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/locks.py:293> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f23302f2a50>()] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:395> cb=[_release_waiter(<Future cance...events.py:395>)() at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/tasks.py:392] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/tasks.py:429> (most recent call last):
[191](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:192)
Stack for <Task pending coro=<BlockchainReaderService.refresh_blocks_forever() running at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/service.py:252> wait_for=<Future pending cb=[_chain_future.<locals>._call_check_cancel() at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/futures.py:351, <TaskWakeupMethWrapper object at 0x7f2328f4df50>()] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:395> created at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/service.py:58> (most recent call last):
[192](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:193)
Stack for <Task pending coro=<RPCSession._receive_messages() running at /home/runner/work/lbry-sdk/lbry-sdk/lbry/wallet/rpc/session.py:406> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f233055c1d0>()] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:395> created at /home/runner/work/lbry-sdk/lbry-sdk/lbry/wallet/rpc/session.py:181> (most recent call last):
[193](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:194)
Stack for <Task pending coro=<SessionManager.serve() running at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/herald/session.py:598> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f233018aed0>()] created at /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py:395> created at /home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/service.py:58> (most recent call last):
[194](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:195)
2022-09-10 02:46:16,526 - lbry.wallet.network - INFO - connection lost to localhost:50002
[195](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:196)
2022-09-10 02:46:16,531 - lbry.wallet.network - INFO - closing connection to localhost:50002
[196](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:197)
2022-09-10 02:46:16,533 - hub.herald.session - INFO - closing down TCP listening servers
[197](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:198)
2022-09-10 02:46:16,533 - hub.herald.session - INFO - disconnect 1 sessions
[198](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:199)
2022-09-10 02:46:16,535 - lbry.wallet.network - DEBUG - Connection lost: localhost:50002
[199](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:200)
2022-09-10 02:46:16,543 - lbry.wallet.database - INFO - DB checkpoint finished.
[200](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:201)
2022-09-10 02:46:16,612 - lbry.wallet.orchstr8.node.lbcwallet - INFO - 2022-09-10 02:46:16.611 [INF] BTCW: Received signal (terminated).  Shutting down...
[201](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:202)
2022-09-10 02:46:16.611 [WRN] BTCW: Stopping legacy RPC server...
[202](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:203)
2022-09-10 02:46:16.611 [INF] BTCW: Legacy RPC server shutdown
[203](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:204)
2022-09-10 02:46:16.612 [INF] BTCW: Shutdown complete
[204](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:205)

[205](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:206)
2022-09-10 02:46:16,613 - lbry.wallet.orchstr8.node.lbcd - INFO - 2022-09-10 02:46:16.611 [ERR] RPCS: Websocket receive error from 127.0.0.1:58324: websocket: close 1006 unexpected EOF
[206](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:207)
2022-09-10 02:46:16.612 [INF] RPCS: Disconnected websocket client 127.0.0.1:58324
[207](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:208)

[208](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:209)
2022-09-10 02:46:16,615 - lbry.wallet.orchstr8.node.lbcwallet - INFO - Done shutting down /home/runner/work/lbry-sdk/lbry-sdk/lbry/wallet/bin/lbcwallet
[209](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:210)
2022-09-10 02:46:16,618 - lbry.wallet.orchstr8.node.lbcd - INFO - 2022-09-10 02:46:16.617 [INF] MAIN: Received signal (terminated).  Shutting down...
[210](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:211)
2022-09-10 02:46:16.617 [INF] MAIN: Gracefully shutting down the server...
[211](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:212)
2022-09-10 02:46:16.617 [WRN] SRVR: Server shutting down
[212](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:213)
2022-09-10 02:46:16.617 [WRN] RPCS: RPC server shutting down
[213](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:214)
2022-09-10 02:46:16.617 [INF] RPCS: RPC server shutdown complete
[214](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:215)
2022-09-10 02:46:16.617 [INF] SYNC: Sync manager shutting down
[215](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:216)
2022-09-10 02:46:16.617 [INF] AMGR: Address manager shutting down
[216](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:217)
2022-09-10 02:46:16.617 [INF] SRVR: Server shutdown complete
[217](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:218)

[218](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:219)
2022-09-10 02:46:16,636 - lbry.wallet.orchstr8.node.lbcd - INFO - 2022-09-10 02:46:16.635 [INF] MAIN: Gracefully shutting down the database...
[219](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:220)

[220](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:221)
2022-09-10 02:46:16,651 - lbry.wallet.orchstr8.node.lbcd - INFO - 2022-09-10 02:46:16.651 [INF] MAIN: Shutdown complete
[221](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:222)

[222](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:223)
2022-09-10 02:46:16,655 - lbry.wallet.orchstr8.node.lbcd - INFO - Done shutting down /home/runner/work/lbry-sdk/lbry-sdk/lbry/wallet/bin/lbcd
[223](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:224)
  File "/home/runner/work/lbry-sdk/lbry-sdk/lbry/wallet/network.py", line 351, in network_loop
[224](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:225)
    return_when=asyncio.FIRST_COMPLETED
[225](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:226)
  File "/home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/notifier_protocol.py", line 54, in maintain_connection
[226](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:227)
    await self._lost_connection.wait()
[227](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:228)
  File "/home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/scribe/service.py", line 1684, in process_blocks_and_mempool_forever
[228](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:229)
    await asyncio.wait_for(self.blocks_event.wait(), self.wait_for_blocks_duration)
[229](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:230)
  File "/home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/herald/session.py", line 1030, in _receive_messages
[230](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:231)
    message = await self.framer.receive_message()
[231](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:232)
  File "/home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/herald/service.py", line 110, in receive_es_notifications
[232](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:233)
    self._es_height, self._es_block_hash = await self.es_notifications.get()
[233](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:234)
  File "/home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/scribe/prefetcher.py", line 47, in main_loop
[234](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:235)
    await asyncio.sleep(self.polling_delay)
[235](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:236)
  File "/home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/herald/mempool.py", line 236, in send_notifications_forever
[236](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:237)
    (session_id, height_changed, hashXes) = await self._notification_q.get()
[237](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:238)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/locks.py", line 293, in wait
[238](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:239)
    await fut
[239](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:240)
  File "/home/runner/work/lbry-sdk/lbry-sdk/lbry/wallet/network.py", line 127, in keepalive_loop
[240](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:241)
    await asyncio.sleep(max(0, max_idle - (now - self.last_send)))
[241](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:242)
  File "/home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/herald/session.py", line 303, in _manage_servers
[242](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:243)
    await self.session_event.wait()
[243](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:244)
  File "/home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/herald/session.py", line 357, in _clear_stale_sessions
[244](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:245)
    await sleep(session_timeout // 10)
[245](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:246)
  File "/home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/service.py", line 252, in refresh_blocks_forever
[246](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:247)
    await self.poll_for_changes()
[247](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:248)
  File "/home/runner/work/lbry-sdk/lbry-sdk/tests/integration/blockchain/test_network.py", line 130, in test_connection_drop_still_receives_events_after_reconnected
[248](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:249)
    sendtxid = await self.send_to_address_and_wait(address1, 1.1337, 1)
[249](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:250)
  File "/home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/elastic_sync/service.py", line 65, in run_es_notifier
[250](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:251)
    await server.serve_forever()
[251](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:252)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/locks.py", line 293, in wait
[252](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:253)
    await fut
[253](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:254)
  File "/home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/service.py", line 252, in refresh_blocks_forever
[254](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:255)
    await self.poll_for_changes()
[255](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:256)
  File "/home/runner/work/lbry-sdk/lbry-sdk/lbry/wallet/rpc/session.py", line 406, in _receive_messages
[256](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:257)
    message = await self.framer.receive_message()
[257](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:258)
  File "/home/runner/work/lbry-sdk/lbry-sdk/.tox/blockchain/lib/python3.7/site-packages/hub/herald/session.py", line 598, in serve
[258](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:259)
    self._manage_servers()
[259](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:260)
ERROR
======================================================================
[5531](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:5532)
ERROR: test_connection_drop_still_receives_events_after_reconnected (integration.blockchain.test_network.ReconnectTests)
[5532](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:5533)
----------------------------------------------------------------------
[5533](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:5534)
Traceback (most recent call last):
[5534](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:5535)
  File "/home/runner/work/lbry-sdk/lbry-sdk/lbry/testcase.py", line 145, in run
[5535](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:5536)
    self.loop.run_until_complete(maybe_coroutine)
[5536](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:5537)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
[5537](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:5538)
    return future.result()
[5538](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:5539)
concurrent.futures._base.CancelledError
[5539](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:5540)

[5540](https://github.com/moodyjon/lbry-sdk/runs/8281332230?check_suite_focus=true#step:11:5541)
----------------------------------------------------------------------

Test code:

        await self.ledger.resolve([], ['derp'])
        sendtxid = await self.send_to_address_and_wait(address1, 1.1337, 1)   <<<<<<<<<<<<<<<<<<< It appears to hang here.
        self.assertLess(self.ledger.network.client.response_time, 1)  # response time properly set lower, we are fine
moodyjon commented 2 years ago

Others: https://github.com/moodyjon/lbry-sdk/runs/8285414453?check_suite_focus=true https://github.com/moodyjon/lbry-sdk/runs/8285937793?check_suite_focus=true https://github.com/moodyjon/lbry-sdk/actions/runs/3038957605/jobs/4893313154

moodyjon commented 2 years ago

The successful runs have a sequence like this after reconnecting to the hub:

157 2022-09-10 16:33:55,042 - lbry.wallet.network - DEBUG - response blockchain.address.subscribe('mxz53icJ1cFwnRr18t5DqNn4JGPj2Dde1r', 'myJZWLw4Y7KXv2qRMrAggBZMknRoTnbDpL', 'mkgkJUvATjuBcpbqNN7TV3Ac6ZQtpjY8uD', 'mqUetgZpp1qQoonG12kcer9LrqaqqXNHma', 'mpN4mcXeMvnWUXY76mGE3xPZS7wV5uFHN6', 'n1F22LL9gN8BbJ9578s9ZPX1vR4D6fyDtw', 'n2nqp5jSLuwtxR5qSLFVUDeE3BHek9itqW', 'mqTUQypVwyV332JPy3YpL1zB4JpgL5xi4G', 'msMs4dcSUP43K2ad9a7PUXLAeBfvHLjQxV', 'n25v1mapwvaaK6Udat6wsbu3fKhf9NA4on', 'mtvdkXoDHQbkYjTtEM91FwudGCqH8GjHmc', 'myvWTXfk7vWN1WLHp2Kg6NJibRfkdWts3x', 'mm96C8qfkBb9M6z5uNGva24Ju1BR9RyPSN', 'mhv7Y3wMs1RUhXi43sZcohxs1h6wnW5JAa', 'mzmshAtC3LuhX1iomr3VnBUii7cnNy4fjw', 'ms6hogVM2VSpmFBiH7ETya2Vi9gJADpysm', 'msCAzJqnwY4ra5aaKCqEHp2HNdgpDW44sz', 'n4NXeVevigtrQH2VbcfYvNtDgHXDEfp2y2', 'mnxbd685JmeQPxGJVkcgGR7RCN2EAwUsCY', 'n4PuP4yyyzA9NdK6KYrcxLS8V7sKjTNWDP') from localhost:50002 (30 timeout) -> [None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None]
[158](https://github.com/moodyjon/lbry-sdk/runs/8285936956?check_suite_focus=true#step:11:159)
2022-09-10 16:33:55,049 - lbry.wallet.ledger - INFO - subscribed to 20/20 addresses on 127.0.0.1:50002
[159](https://github.com/moodyjon/lbry-sdk/runs/8285936956?check_suite_focus=true#step:11:160)
2022-09-10 16:33:55,049 - lbry.wallet.ledger - INFO - finished subscribing to 20 addresses on 127.0.0.1:50002
[160](https://github.com/moodyjon/lbry-sdk/runs/8285936956?check_suite_focus=true#step:11:161)
2022-09-10 16:33:55,058 - lbry.wallet.orchstr8.node.lbcwallet - INFO - 2022-09-10 16:33:55.042 [INF] TMGR: Inserting unconfirmed transaction 9c98c78d76060f70982ea1c582ccdef053387813b5c8b0de88a2610b388b1166
[161](https://github.com/moodyjon/lbry-sdk/runs/8285936956?check_suite_focus=true#step:11:162)
2022-09-10 16:33:55.045 [INF] RPCS: Successfully sent transaction 9c98c78d76060f70982ea1c582ccdef053387813b5c8b0de88a2610b388b1166
[162](https://github.com/moodyjon/lbry-sdk/runs/8285936956?check_suite_focus=true#step:11:163)

[163](https://github.com/moodyjon/lbry-sdk/runs/8285936956?check_suite_focus=true#step:11:164)
2022-09-10 16:33:55,059 - lbry.wallet.network - DEBUG - send blockchain.address.subscribe('mhG1s7Ys3AAT74pYgBXihznjWLZEPV3vn9', 'n33ejxZxApkAK3nHUJKZaJ9x8NKAAWTPAp', 'myutFwGKkp8idngwyQtybfs5LdmwrnGpyU', 'mmc46TfoYaQURhhKbtHcNtK4eipzwjYZua', 'mkUq8YoWTTKgePdv4YSQjx2PAp2gcgxysm', 'mooPF6UoABcUQ6GJwhEJosjnSqNRLRT4zR') to localhost:50002 (30 timeout)
[164](https://github.com/moodyjon/lbry-sdk/runs/8285936956?check_suite_focus=true#step:11:165)
2022-09-10 16:33:55,064 - lbry.wallet.orchstr8.node.lbcwallet - INFO - 9c98c78d76060f70982ea1c582ccdef053387813b5c8b0de88a2610b388b1166
[165](https://github.com/moodyjon/lbry-sdk/runs/8285936956?check_suite_focus=true#step:11:166)
2022-09-10 16:33:55,076 - lbry.wallet.network - DEBUG - response blockchain.address.subscribe('mhG1s7Ys3AAT74pYgBXihznjWLZEPV3vn9', 'n33ejxZxApkAK3nHUJKZaJ9x8NKAAWTPAp', 'myutFwGKkp8idngwyQtybfs5LdmwrnGpyU', 'mmc46TfoYaQURhhKbtHcNtK4eipzwjYZua', 'mkUq8YoWTTKgePdv4YSQjx2PAp2gcgxysm', 'mooPF6UoABcUQ6GJwhEJosjnSqNRLRT4zR') from localhost:50002 (30 timeout) -> [None, None, None, None, None, None]
[166](https://github.com/moodyjon/lbry-sdk/runs/8285936956?check_suite_focus=true#step:11:167)
2022-09-10 16:33:55,078 - lbry.wallet.ledger - INFO - subscribed to 6/6 addresses on 127.0.0.1:50002
[167](https://github.com/moodyjon/lbry-sdk/runs/8285936956?check_suite_focus=true#step:11:168)
2022-09-10 16:33:55,078 - lbry.wallet.ledger - INFO - finished subscribing to 6 addresses on 127.0.0.1:50002
[168](https://github.com/moodyjon/lbry-sdk/runs/8285936956?check_suite_focus=true#step:11:169)
2022-09-10 16:33:55,230 - lbry.wallet.network - DEBUG - send blockchain.address.get_history('n2nqp5jSLuwtxR5qSLFVUDeE3BHek9itqW',) to localhost:50002 (30 timeout)
[169](https://github.com/moodyjon/lbry-sdk/runs/8285936956?check_suite_focus=true#step:11:170)
2022-09-10 16:33:55,234 - lbry.wallet.network - DEBUG - response blockchain.address.get_history('n2nqp5jSLuwtxR5qSLFVUDeE3BHek9itqW',) from localhost:50002 (30 timeout) -> [{'tx_hash': '9c98c78d76060f70982ea1c582ccdef053387813b5c8b0de88a2610b388b1166', 'height': 0, 'fee': 376}]
[170](https://github.com/moodyjon/lbry-sdk/runs/8285936956?check_suite_focus=true#step:11:171)
2022-09-10 16:33:55,234 - lbry.wallet.ledger - DEBUG - request 1 transactions, 0/1 for n2nqp5jSLuwtxR5qSLFVUDeE3BHek9itqW are already synced
[171](https://github.com/moodyjon/lbry-sdk/runs/8285936956?check_suite_focus=true#step:11:172)
2022-09-10 16:33:55,234 - lbry.wallet.network - DEBUG - send blockchain.transaction.get_batch('9c98c78d76060f70982ea1c582ccdef053387813b5c8b0de88a2610b388b1166',) to localhost:50002 (30 timeout)
[172](https://github.com/moodyjon/lbry-sdk/runs/8285936956?check_suite_focus=true#step:11:173)
2022-09-10 16:33:55,239 - lbry.wallet.network - DEBUG - response blockchain.transaction.get_batch('9c98c78d76060f70982ea1c582ccdef053387813b5c8b0de88a2610b388b1166',) from localhost:50002 (30 timeout) -> {'9c98c78d76060f70982ea1c582ccdef053387813b5c8b0de88a2610b388b1166': ['010000000200fe5c65139aa0ebdd39a07ff4e22bcf92f365fa84232beef9d233c6702439b1000000006b483045022100d310445d1a9bb2b21379554048438c4a4a4b7e9d4323fc8fcf223421b05fa86802206feaf9e485d1ebb32d15e4ce92f8fee3ab73e065860f19213afc70a7100555e30121033e68152333aee2004d7e226c27f8b42f6aa568caf31a02bd5c2fbccdbcb17399ffffffff01a7941c074b3800205f5b9af4a5b71214acc3cfdcad1ccc210c2ef71fa13720000000006a47304402202ff9021c1358c84a5d6764a1cf3eb65813d4868d059389e35e3814f6b3c75327022070c47bbf2c84c8c6e685243184bafbd1aa55ce9ce0385f0487eba3acce0333a50121033e68152333aee2004d7e226c27f8b42f6aa568caf31a02bd5c2fbccdbcb17399ffffffff02f8dc2905000000001976a9142d5e3d0953c33b13f21c980f4767e761779ba12988ac90e3c106000000001976a914e95be2bead109a5c9a508b7562c8cd424ad70bd188ac00000000', {'block_height': -1}]}
[173](https://github.com/moodyjon/lbry-sdk/runs/8285936956?check_suite_focus=true#step:11:174)
2022-09-10 16:33:55,244 - lbry.wallet.ledger - INFO - (lbc_regtest) on_transaction: address=n2nqp5jSLuwtxR5qSLFVUDeE3BHek9itqW, height=0, is_verified=False,

Unsuccessful ones don't do blockchain.address.get_history, so no on_transaction notification is generated.

moodyjon commented 2 years ago

@eukreign @jackrobison

moodyjon commented 2 years ago

Another: https://github.com/moodyjon/lbry-sdk/actions/runs/3040634276/jobs/4896910797 https://github.com/moodyjon/lbry-sdk/actions/runs/3040632508/jobs/4896907603 https://github.com/moodyjon/lbry-sdk/actions/runs/3044957776/jobs/4905927570

It looks like hub fails to send a status update. In passing runs, Ledger.process_status_update() is called. In failing runs, it's NOT called, leading to the hang.

moodyjon commented 2 years ago

I just dug into how the subscriptions are kept, and the session object id() (memory addr) determines which session gets notified.

https://github.com/lbryio/hub/blob/18e0571e81ce3ad9da25ee0d2cf4d9d075d04999/hub/herald/session.py#L1430

moodyjon commented 2 years ago

Another: https://github.com/moodyjon/lbry-sdk/actions/runs/3062365461/jobs/4943260222 https://github.com/moodyjon/lbry-sdk/actions/runs/3062365671/jobs/4943260224

moodyjon commented 2 years ago

Another: https://github.com/moodyjon/lbry-sdk/actions/runs/3063166402/jobs/4944948913

This one has some more logging. There is an initial pass through the mempool logic to compute notifications. But the subscription has not been made at that moment. An empty notification? is generated.

2022-09-15 20:12:01,791 - lbry.wallet.orchstr8.node.lbcwallet - INFO - 232a4672922da996b2998fae35b42b599a9401998a6b12d41e3a1ee21e15411c
[1182](https://github.com/moodyjon/lbry-sdk/actions/runs/3063166402/jobs/4944948913#step:11:1183)
2022-09-15 20:12:01,791 - lbry.testcase - WARNING - before: done = False, tx_watch = []
[1183](https://github.com/moodyjon/lbry-sdk/actions/runs/3063166402/jobs/4944948913#step:11:1184)
2022-09-15 20:12:01,883 - hub.herald.mempool - INFO - touched hashXs: 3
[1184](https://github.com/moodyjon/lbry-sdk/actions/runs/3063166402/jobs/4944948913#step:11:1185)
2022-09-15 20:12:01,885 - hub.herald.mempool - INFO - touched hashXs with subscription: 0
[1185](https://github.com/moodyjon/lbry-sdk/actions/runs/3063166402/jobs/4944948913#step:11:1186)
2022-09-15 20:12:01,885 - hub.herald.mempool - INFO - sessions with touched hashXs: 0
[1186](https://github.com/moodyjon/lbry-sdk/actions/runs/3063166402/jobs/4944948913#step:11:1187)
2022-09-15 20:12:01,885 - hub.herald.mempool - INFO - notification queued for session ('127.0.0.1', 55032) height_changed=False hashXes: None
moodyjon commented 2 years ago

More context from last update:

n2HX6cy5yQcUfk1s625zB7XnUCbwQk8i2t is the receiving address I think. The order of events is:

1) subscription RPC sent by client 2) lbcctl returns after sending transaction 3) hub runs through notification logic (hub.herald.mempool). no subscription found. 4) hub reply to subscription with hashX status None

2022-09-15T20:12:01.7226863Z 2022-09-15 20:12:01,722 - lbry.wallet.ledger - INFO - Subscribe to 1 accounts
2022-09-15T20:12:01.7266571Z 2022-09-15 20:12:01,726 - lbry.wallet.network - DEBUG - send blockchain.address.subscribe('n2HX6cy5yQcUfk1s625zB7XnUCbwQk8i2t', 'myFydtv4PSRyVXZ4Soi7Y2U6NNh4B9o2w2', 'n2EMYrgpLgn2pdsyjXwm4AjDeksgnn71uQ', 'n3FNqBoSce7uek4Hwj4bkW8PyvC672aeMC', 'mugRn1EdwPMdrEWAqz7ewZ2eg8XavWrr9W', 'n3Y8kNJW8BNxCi6NvDLpfdx6QrgdVo1Fjn', 'n1EC5EZLuTq634sc3j8T2DgUBsa7vu6nS1', 'mqkDXc4Z9jDCxAowLqZF48gSxNipL4ZhEa', 'mw49T2dVkqoMh9rGaG5oJNgZnhFs5dpZqJ', 'mmhgho3cFZ6gixX7Lio7DKJ871faAzC16L', 'mqorh8iAo7bfRuotRva6ZPuERAZYyhvppd', 'mrZsf77QhB2txYTiMZHMUcdwLSQK2nUoUb', 'mznewhHNjGgc74pC9Q8HjkNVpLDdZ1K6FY', 'mxvWUfLUUV4VbvL3s5u2cJLSEvsf1j161G', 'mxKCim8vxJvdoQgXicLzDCSb1NDQKXk4wK', 'mvaFiVctFjtzVw6DzWB1dnUYSr88hFh2uX', 'mzHUKjxzoZbNvsSEJRgbmtb7AwKS2jB39k', 'mqKxsnpgoAy1QgJ21oGKs66EiFfJVL73oK', 'mhXMbDUCGwe33Ch8zG6Qk1PyZ2wbWWKxUG', 'mobPRfdG8CWWjH8YcZVFbYya5Zd3cYWees') to localhost:50002 (30 timeout)
2022-09-15T20:12:01.7296490Z 2022-09-15 20:12:01,729 - hub.herald.session - DEBUG - Sending framed message b'{"jsonrpc":"2.0","result":"CiV6IwgBEh9Db3VsZCBub3QgZmluZCBjbGFpbSBhdCAiZGVycCIu","id":571}\n'
2022-09-15T20:12:01.7337391Z 2022-09-15 20:12:01,733 - lbry.wallet.network - DEBUG - response blockchain.claimtrie.resolve('derp',) from localhost:50002 (30 timeout) -> CiV6IwgBEh9Db3VsZCBub3QgZmluZCBjbGFpbSBhdCAiZGVycCIu
2022-09-15T20:12:01.7347087Z 2022-09-15 20:12:01,734 - lbry.wallet.orchstr8.node.lbcwallet - INFO - /home/runner/work/lbry-sdk/lbry-sdk/lbry/wallet/bin/lbcctl --rpcuser=rpcuser --rpcpass=rpcpassword --notls --regtest --wallet sendtoaddress n2HX6cy5yQcUfk1s625zB7XnUCbwQk8i2t 1.1337
2022-09-15T20:12:01.7840435Z 2022-09-15 20:12:01,783 - lbry.wallet.orchstr8.node.lbcwallet - INFO - 2022-09-15 20:12:01.782 [INF] TMGR: Inserting unconfirmed transaction 232a4672922da996b2998fae35b42b599a9401998a6b12d41e3a1ee21e15411c
2022-09-15T20:12:01.7841648Z 
2022-09-15T20:12:01.7890053Z 2022-09-15 20:12:01,787 - lbry.wallet.orchstr8.node.lbcwallet - INFO - 2022-09-15 20:12:01.787 [INF] RPCS: Successfully sent transaction 232a4672922da996b2998fae35b42b599a9401998a6b12d41e3a1ee21e15411c
2022-09-15T20:12:01.7890902Z 
2022-09-15T20:12:01.7913989Z 2022-09-15 20:12:01,791 - lbry.wallet.orchstr8.node.lbcwallet - INFO - 232a4672922da996b2998fae35b42b599a9401998a6b12d41e3a1ee21e15411c
2022-09-15T20:12:01.7915010Z 2022-09-15 20:12:01,791 - lbry.testcase - WARNING - before: done = False, tx_watch = []
2022-09-15T20:12:01.8837571Z 2022-09-15 20:12:01,883 - hub.herald.mempool - INFO - touched hashXs: 3
2022-09-15T20:12:01.8853363Z 2022-09-15 20:12:01,885 - hub.herald.mempool - INFO - touched hashXs with subscription: 0
2022-09-15T20:12:01.8854310Z 2022-09-15 20:12:01,885 - hub.herald.mempool - INFO - sessions with touched hashXs: 0
2022-09-15T20:12:01.8861004Z 2022-09-15 20:12:01,885 - hub.herald.mempool - INFO - notification queued for session ('127.0.0.1', 55032) height_changed=False hashXes: None
2022-09-15T20:12:01.8979351Z 2022-09-15 20:12:01,897 - hub.herald.session - DEBUG - Sending framed message b'{"jsonrpc":"2.0","result":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"id":572}\n'
2022-09-15T20:12:01.8998519Z 2022-09-15 20:12:01,899 - lbry.wallet.network - DEBUG - response blockchain.address.subscribe('n2HX6cy5yQcUfk1s625zB7XnUCbwQk8i2t', 'myFydtv4PSRyVXZ4Soi7Y2U6NNh4B9o2w2', 'n2EMYrgpLgn2pdsyjXwm4AjDeksgnn71uQ', 'n3FNqBoSce7uek4Hwj4bkW8PyvC672aeMC', 'mugRn1EdwPMdrEWAqz7ewZ2eg8XavWrr9W', 'n3Y8kNJW8BNxCi6NvDLpfdx6QrgdVo1Fjn', 'n1EC5EZLuTq634sc3j8T2DgUBsa7vu6nS1', 'mqkDXc4Z9jDCxAowLqZF48gSxNipL4ZhEa', 'mw49T2dVkqoMh9rGaG5oJNgZnhFs5dpZqJ', 'mmhgho3cFZ6gixX7Lio7DKJ871faAzC16L', 'mqorh8iAo7bfRuotRva6ZPuERAZYyhvppd', 'mrZsf77QhB2txYTiMZHMUcdwLSQK2nUoUb', 'mznewhHNjGgc74pC9Q8HjkNVpLDdZ1K6FY', 'mxvWUfLUUV4VbvL3s5u2cJLSEvsf1j161G', 'mxKCim8vxJvdoQgXicLzDCSb1NDQKXk4wK', 'mvaFiVctFjtzVw6DzWB1dnUYSr88hFh2uX', 'mzHUKjxzoZbNvsSEJRgbmtb7AwKS2jB39k', 'mqKxsnpgoAy1QgJ21oGKs66EiFfJVL73oK', 'mhXMbDUCGwe33Ch8zG6Qk1PyZ2wbWWKxUG', 'mobPRfdG8CWWjH8YcZVFbYya5Zd3cYWees') from localhost:50002 (30 timeout) -> [None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None]

Client did not receive the status update through either path -- neither initial subscribe response nor notification.

It looks like subscription is done right:

    async def hashX_subscribe(self, hashX, alias):
        self.hashX_subs[hashX] = alias
        self.session_manager.hashx_subscriptions_by_session[hashX].add(id(self))
        return await self.address_status(hashX)

address_status() is called after hash_subscriptions_by_session is updated. So there should not be a window of time where we miss an update.

moodyjon commented 2 years ago

But.... address_subscribe() is not written the same way. It's potentially racy:

        if len(addresses) > 1000:
            raise RPCError(BAD_REQUEST, f'too many addresses in subscription request: {len(addresses)}')
        hashXes = [item async for item in asyncify_for_loop((self.address_to_hashX(address) for address in addresses), 100)]
        statuses = await self.get_hashX_statuses(hashXes).   <<<<<<<<<<< get status BEFORE subscription
        for hashX, alias in zip(hashXes, addresses):
            self.hashX_subs[hashX] = alias
            self.session_manager.hashx_subscriptions_by_session[hashX].add(id(self))
        self.session_manager.address_subscription_metric.inc(len(addresses))
        return statuses
moodyjon commented 2 years ago

Inserting a 1s sleep after statuses = await self.get_hashX_statuses reproduced the problem 5 of 5 runs. Unfortunately, it disrupts a large number of other tests, so running it in the GitHub workflow is difficult.

The fix should be to retrieve get_hashX_statuses AFTER updating the subscription data structures.