Closed moodyjon closed 2 years ago
Another: https://github.com/moodyjon/lbry-sdk/actions/runs/3063168288/jobs/4944952002
This one has some logging, and it looks like the pay()
task is about to call get_server_features()
when an exception happens. The exception comes from retriable_call()
when not self.running
. At the moment the call is attempted, the wallet connection is being bounced with ledger.stop()
and ledger.start()
.
Added some code to catch and log the exception.
Got it! asyncio.Cancelled error is happening because jsonrpc_wallet_reconnect()
disconnects & reconnects the network.
https://github.com/moodyjon/lbry-sdk/actions/runs/3068903241/jobs/4956923296
2022-09-16 15:34:43,165 - lbry.wallet.usage_payment - WARNING - pay loop: no address or no amount
[7363](https://github.com/moodyjon/lbry-sdk/actions/runs/3068903241/jobs/4956923296#step:11:7364)
2022-09-16 15:34:43,165 - lbry.wallet.usage_payment - INFO - pay loop: before sleep
[7364](https://github.com/moodyjon/lbry-sdk/actions/runs/3068903241/jobs/4956923296#step:11:7365)
2022-09-16 15:34:43,258 - hub.herald.session - INFO - TCP server listening on 127.0.0.1:50003
[7365](https://github.com/moodyjon/lbry-sdk/actions/runs/3068903241/jobs/4956923296#step:11:7366)
2022-09-16 15:34:43,261 - lbry.wallet.network - INFO - closing connection to localhost:50002
[7366](https://github.com/moodyjon/lbry-sdk/actions/runs/3068903241/jobs/4956923296#step:11:7367)
2022-09-16 15:34:43,261 - lbry.wallet.network - INFO - connection lost to localhost:50002
[7367](https://github.com/moodyjon/lbry-sdk/actions/runs/3068903241/jobs/4956923296#step:11:7368)
2022-09-16 15:34:43,262 - lbry.wallet.network - INFO - network loop finished
[7368](https://github.com/moodyjon/lbry-sdk/actions/runs/3068903241/jobs/4956923296#step:11:7369)
2022-09-16 15:34:43,262 - lbry.wallet.network - DEBUG - Connection lost: localhost:50002
[7369](https://github.com/moodyjon/lbry-sdk/actions/runs/3068903241/jobs/4956923296#step:11:7370)
2022-09-16 15:34:43,265 - lbry.wallet.database - INFO - DB checkpoint finished.
[7370](https://github.com/moodyjon/lbry-sdk/actions/runs/3068903241/jobs/4956923296#step:11:7371)
2022-09-16 15:34:43,267 - lbry.wallet.usage_payment - INFO - pay loop: before get_server_features
[7371](https://github.com/moodyjon/lbry-sdk/actions/runs/3068903241/jobs/4956923296#step:11:7372)
2022-09-16 15:34:43,268 - lbry.wallet.usage_payment - WARNING - Caught exception: CancelledError. <<<<<<<<<<<<<<<<<<<<<<<< pay task exits early
[7372](https://github.com/moodyjon/lbry-sdk/actions/runs/3068903241/jobs/4956923296#step:11:7373)
2022-09-16 15:34:43,269 - lbry.wallet.usage_payment - INFO - Stopping wallet server payments. Cancelled
[7373](https://github.com/moodyjon/lbry-sdk/actions/runs/3068903241/jobs/4956923296#step:11:7374)
2022-09-16 15:34:43,273 - lbry.wallet.database - INFO - connecting to database: /tmp/tmpflyzv0iy/lbc_regtest/blockchain.db
[7374](https://github.com/moodyjon/lbry-sdk/actions/runs/3068903241/jobs/4956923296#step:11:7375)
2022-09-16 15:34:43,289 - lbry.wallet.network - INFO - 1 possible spv servers to try (1 urls in config)
[7375](https://github.com/moodyjon/lbry-sdk/actions/runs/3068903241/jobs/4956923296#step:11:7376)
2022-09-16 15:34:43,291 - lbry.wallet.network - INFO - localhost:50003 has latency of 1.08ms (available: True, height: 206)
[7376](https://github.com/moodyjon/lbry-sdk/actions/runs/3068903241/jobs/4956923296#step:11:7377)
2022-09-16 15:34:43,292 - lbry.wallet.udp - INFO - closed udp spv server selection client
[7377](https://github.com/moodyjon/lbry-sdk/actions/runs/3068903241/jobs/4956923296#step:11:7378)
2022-09-16 15:34:43,301 - lbry.wallet.network - INFO - Connected to spv server localhost:50003
This seems similar to https://github.com/lbryio/hub/issues/98 but happens after a shorter 30s timeout is hit. The ledger is connected to a newly started SPVNode instead of reconnecting to the same node.
Test code: