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

getblocks retry 5 times before giving up #117

Closed
wants to merge 1 commit into from

Conversation

RCasatta
Copy link
Collaborator

No description provided.


match daemon.getblocks(&blockhashes) {
Ok(blocks) => break blocks,
Err(e) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps this should explicitly check for "Block not found on disk" errors and terminate the thread for other unexpected errors?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

On a second thought non recoverable errors will panic anyway after 5 attempts, while recoverable errors will leave a trace in the logs. Are we sure we don't want to retry with any error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Anyway, I opened #118 which retry only on "Block not found on disk", one or the other is fine for me

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks. I generally prefer to fail fast, if both are fine by you then I would go with #118

(Perhaps also worth mentioning that the daemon already detects connection errors and retries for all RPC commands, so the explicit "Block not found on disk" handling here is done on top of that behavior.)

@RCasatta
Copy link
Collaborator Author

closing in favor of #118

@RCasatta RCasatta closed this Sep 30, 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.

2 participants