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

Handle block count RPC error gracefully #1637

Merged
merged 2 commits into from
Feb 21, 2023

Conversation

andrewtoth
Copy link
Contributor

@andrewtoth andrewtoth commented Feb 10, 2023

If we fail to fetch the block count, it will just return an error from update_index with a JSON-RPC error. However, any uncommitted blocks will not be committed because it doesn't exit the loop. They will have to be indexed again.

This PR will just log the error but continue indexing, so we can keep our cache. It will show a progress greater than 100%, but better than having a JSON-RPC error and uncommitted blocks.

The json-rpc client times out and fails if it's not used for a long time, like during a long index update. Since a new client is created to fetch blocks in the background, the index.client is not used until near the end, where it already timed out.

@donnlee
Copy link

donnlee commented Feb 18, 2023

I confirm that casey@50f2ad7 on ord 0.5.0 has fixed the time-wasting issue of blocks re-indexing at 775000 every time.
This is awesome. I was able to finish the last 1% of indexing today 🎉
Now i have an ord index compatible with 0.5.0

@vicariousdrama
Copy link

I second @donnlee . My node succeeded on this as well (4GB raspberry pi)

@dougEfresh
Copy link

This PR works!

Copy link
Collaborator

@raphjaph raphjaph left a comment

Choose a reason for hiding this comment

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

ACK by peanut gallery!

@raphjaph raphjaph merged commit 63b57ad into ordinals:master Feb 21, 2023
@andrewtoth andrewtoth deleted the handle-block-count-error branch February 21, 2023 20:12
@jesuspb2
Copy link

Hi guys,

I have the version 0.5.0 and I still have the issue of indexing: HTTP response too short: length 0, needed 12

What can I do in this case?
Thank you

@andrewtoth
Copy link
Contributor Author

@jesuspb2 upgrade to 0.5.1.

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.

6 participants