-
Notifications
You must be signed in to change notification settings - Fork 10
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
Halt prevention #141
Comments
Proposal
|
I'm having a difficult time conceiving of a way to test a case where a tx with either unexpected or malformed data makes it through the network to be picked up by the indexer. It seems to me that to test this properly, we would need to introduce a mock somewhere which can implement this incorrect behavior reliably and more straightforwardly (in my opinion). One example of this would be to mock a fetchd endpoint which we would point the indexer at for classes of tests which require test-specific behavior from their integrated components (fetchd, in this case). Unfortunately, that adds complexity and overhead to getting a useful test in place for this change. I would propose to tackle that in additional PRs, the failsafe error log should suffice in the meantime. I've opened #180 to track this. |
Proposal for testingWe could construct an inert (i.e. doesn't interact with the DB) handler which only serves to throw an error in the main function body, while following the conventional error handling pattern: export async function handleTestUnprocessed(event: CosmosEvent): Promise<void> {
attemptHandling(() => {throw new Error("test error")}, unprocessedEventHandler);
} |
There seems to be some higher-level error handling which is aware of the sequelize client state and is "out-scoping" our in-handler error handling, at least in the case where the SQL transaction failed:
Additionally, as the error message indicates, we don't seem to be able to save an |
Background
Currently, mapping handler functions can throw errors which will cause the subquery node process to terminate. Outside the context of mapping handlers, in the event of non-persistent errors (e.g. network interruptions), this behavior is desirable as it delegates the responsibility of resuming the process to the orchestration environment (kubernetes). However, once control flow reaches a mapping handler, I suspect that all errors are classifiable as persistent (i.e. would be deterministically reproducible given the same input and handler function).
Relevance to #91
One of the benefits of re-indexing from genesis in our preview environments is that we ensure that the indexer will not halt (on historical data), and if it does, we have the opportunity to iterate, all without affecting the availability of production data. Once we start using migrations to transform the data from one state to another, we will no longer be exercising the mapping handlers for data which was indexed prior to a given migration. In other words, it will become possible that the DB can be in a state which it could not have reached by re-indexing from scratch. This interaction with migrations increases the likelihood that a class of bug survives the preview environment to be encountered in production. This is not acceptable.
Acceptance criteria
All mapping handler functions MUST:
handler function name,(redundant) provided arguments, and the error message/stack(We can design the retry mechanism in subsequent work)
The text was updated successfully, but these errors were encountered: