Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry failed RPC calls on error #707

Closed
wants to merge 1 commit into from

Conversation

afilini
Copy link
Member

@afilini afilini commented Aug 9, 2022

Description

Whenever the transport errors with "WouldBlock" we wait a bit and retry the call.

This partially fixes #650, at least the errors happening with the RPC blockchain reported here: #650 (comment)

Notes to the reviewers

I'm a bit puzzled because in my tests I still have failures, but this time with the error:

Rpc(JsonRpc(Rpc(RpcError { code: -4, message: "Wallet is currently rescanning. Abort existing rescan or wait.", data: None })))

even though the wallet have just been created. I even tried adding another "await_wallet_scan" before our importdescriptors and it didn't make any difference.

To consistently reproduce this issue I ran the tests in a large (>=16 vCPUs) instance on AWS.

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature
  • I've updated CHANGELOG.md

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

@afilini afilini force-pushed the fix/rpc-retry-on-error branch from bfe86cd to 9aa08ed Compare August 9, 2022 15:56
Whenever the transport errors with "WouldBlock" we wait a bit and retry
the call.

Related to bitcoindevkit#650, should at least fix the errors with RPC
@afilini afilini force-pushed the fix/rpc-retry-on-error branch from 9aa08ed to ccb951a Compare August 10, 2022 10:10
@evanlinjin
Copy link
Member

evanlinjin commented Aug 11, 2022

@afilini Let me know if this is helpful in dealing with the code: -4 errors: afilini#5

In either case, I feel like this is a good-to-have, just in case a wallet rescan is triggered elsewhere (rather than BDK).

@evanlinjin
Copy link
Member

Closing this for now as this deals with legacy code.

@evanlinjin evanlinjin closed this Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI: blockchain::esplora::bdk_blockchain_tests::test_sync_stop_gap_20 occationally fails
2 participants