Skip to content

Handle HyperSync logs query errors - #502

Merged
DZakh merged 2 commits into
mainfrom
dz/handle-get-logs-error
Apr 7, 2025
Merged

DZakh merged 2 commits into
mainfrom
dz/handle-get-logs-error

Conversation

@DZakh

@DZakh DZakh commented Apr 3, 2025

Copy link
Copy Markdown
Member

Don't crash the indexer on HyperSync logs request query error. Infinitely retry with the support of a fallback data source.

Comment on lines +395 to +401
// Starting from the 11th failure (retry=10)
// include fallback sources for switch
// (previously it would consider only sync sources or the initial one)
// This is a little bit tricky to find the right number,
// because meaning between RPC and HyperSync is different for the error
// but since Fallback was initially designed to be used only for height check
// just keep the value high

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should probably note this in the config description. Since a user might want to have an expensive rpc for the head and not use it for the sync.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hm, probably need to add the logic to disable fallbacks for historical sync

| WrongInstance =>
let backoffMillis = switch retry {
| 0 => 100
| _ => 500 * retry

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe this should have ceiling? A multiplicative of 500 is huge if somehow this happens multiple times.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There's a global ceiling of 60 seconds

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ok sweet 👍🏼

@JonoPrest JonoPrest left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, thanks @DZakh

@DZakh
DZakh merged commit 8c5520e into main Apr 7, 2025
@DZakh
DZakh deleted the dz/handle-get-logs-error branch April 7, 2025 15:06
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.

Fallback to RPC when "Received page response from another instance of HyperSync" error maxes retries limit

2 participants