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

fix: ChainTask: retry on RPC request error #715

Merged
merged 1 commit into from
Jun 2, 2022

Conversation

blckngm
Copy link
Contributor

@blckngm blckngm commented Jun 1, 2022

Added a exponential backoff utility, with full random jitter support.

The p2p network re-connect is also changed to use this backoff utility.

Manually tested with stopping and restarting ckb/ckb-indexer in kicker. Close #676.

@gw-bot
Copy link

gw-bot bot commented Jun 1, 2022

Running integration test

Workflow Run Id: 2420237040

Components:

Manually running integration test

Post a comment contains

/itest
[prebuilds: tag]
[godwoken: branch/ref]
[scripts: branch/ref]
[polyjuice: branch/ref]
[web3: branch/ref]
[kicker: branch/ref]
[tests: branch/ref]

Note: [] means optional, for example

/itest
prebuilds: dev-202203280240
godwoken: develop
scripts: 81676d9d53ffdf5bbaa60483928d07da16eb4a88
polyjuice: e37553b9

Run Result

success

@blckngm blckngm requested review from jjyr and zeroqn June 1, 2022 08:26
Added a exponential backoff utility, with full random jitter support.

The p2p network re-connect is also changed to use this backoff utility.
@blckngm blckngm force-pushed the chain-task-retry-request-error branch from 4c6e234 to 6319c79 Compare June 1, 2022 08:28
log::error!("chain polling loop exit unexpected, error: {}", err);
while let Err(err) = chain_task.run(&mut backoff).await {
if err.is::<RPCRequestError>() {
log::error!("chain polling loop request error, will retry: {}", err);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest log sleep duration

@jjyr jjyr merged commit 0698098 into godwokenrises:develop Jun 2, 2022
@blckngm blckngm deleted the chain-task-retry-request-error branch July 12, 2022 01:34
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.

Godwoken v1 node exits after losing connection with CKB node.
3 participants