Skip to content

Halt prevention #141

@bryanchriswhite

Description

@bryanchriswhite

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:

  1. catch any error thrown downstream of them
  2. persist the handler function name,(redundant) provided arguments, and the error message/stack
    • persisted data MUST be sufficient to retry later
  3. log a warning
  4. allow the indexer to continue

(We can design the retry mechanism in subsequent work)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Something isn't workingC-enhancementCategory: New feature or requestP-highPriority: High priority task

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions