RPC as a fallback#467
Merged
Merged
Conversation
DZakh
commented
Mar 7, 2025
Comment on lines
+307
to
+331
| | Source.GetItemsError(error) => { | ||
| // TODO: When we start handling fetch failures, | ||
| // we shouldn't delete the source from the set | ||
| // but keep it for retries. Still need to delete | ||
| // for cases like UnsupportedSelection which are | ||
| // not retryable | ||
| let notAlreadyDeleted = sourceManager.sources->Utils.Set.delete(source) | ||
|
|
||
| // In case there are multiple partitions | ||
| // failing at the same time. Log only once | ||
| if notAlreadyDeleted { | ||
| switch error { | ||
| | UnsupportedSelection({message}) => logger->Logging.childError(message) | ||
| | FailedGettingFieldSelection({message, blockNumber, logIndex}) | ||
| | FailedParsingItems({message, blockNumber, logIndex}) => | ||
| logger->Logging.childError({ | ||
| "msg": message, | ||
| "blockNumber": blockNumber, | ||
| "logIndex": logIndex, | ||
| }) | ||
| } | ||
| } | ||
|
|
||
| switch sourceManager->getNextActiveSource { | ||
| | None => { |
Member
Author
There was a problem hiding this comment.
This is not the most robust logic, and can be improved in the future. But currently it only applies to RPC data-sources and good enough to prevent Fallback sources from killing the indexer when there are still other sources.
| } | ||
| } | ||
| // TODO: Handle more error cases and hang/retry instead of throwing | ||
| | exn => exn->ErrorHandling.mkLogAndRaise(~logger, ~msg="Failed to fetch block Range") |
Member
Author
There was a problem hiding this comment.
HyperSync will fail as before
Member
Author
There was a problem hiding this comment.
Should I catch it and dispatchAction(ErrorExit(errHandler)) or simply throwing is fine?
Closed
JonoPrest
reviewed
Mar 11, 2025
| let backoff = if retry === 0 { | ||
| 1 | ||
| } else { | ||
| retry * backoffMultiplicative |
Collaborator
There was a problem hiding this comment.
Lets make this exponential
JonoPrest
reviewed
Mar 11, 2025
Comment on lines
+361
to
+362
| // Hang until the process is terminated | ||
| await Promise.make((_, _) => ()) |
JonoPrest
reviewed
Mar 11, 2025
Comment on lines
+766
to
+768
| ~executeQuery=async query => { | ||
| let response = await chainFetcher.sourceManager->executeQuery(~query, ~currentBlockHeight) | ||
| dispatchAction(PartitionQueryResponse({chain, response, query})) |
Collaborator
There was a problem hiding this comment.
Lets keep the error exit explicit with try catch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1: #464
Part 2: #465
Part 3: