-
Notifications
You must be signed in to change notification settings - Fork 16
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
RPC fallback final touches #467
base: dz/fallback-rpc-2
Are you sure you want to change the base?
Conversation
| 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 => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HyperSync will fail as before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I catch it and dispatchAction(ErrorExit(errHandler))
or simply throwing is fine?
todo: write tests