Skip to content
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

feat: alert instead of crashing relayer when building cursors #4811

Merged
merged 4 commits into from
Nov 5, 2024

Conversation

daniel-savu
Copy link
Contributor

@daniel-savu daniel-savu commented Nov 4, 2024

Description

  • we should make sure there are no unwraps outside a tokio::spawn, otherwise they'll take down the entire relayer. The offenders have so far been the indexing cursors, so this PR just logs an error and sets a new metric flag instead of panicking: critical_error, an IntGauge type because prometheus doesn't have boolean gauges. For now this is only used for origin chains, but I envision this as being set when a critical error occurs in the submitter too, in the future
  • before setting the flag, cursor instantiation is now retried 10 times (to avoid short lived RPC hiccups)

Drive-by changes

Removes usage of Builder derive macro in metric types, since they're not complex enough to warrant it

Related issues

Backward compatibility

Yes

Testing

the existing e2e

Copy link

changeset-bot bot commented Nov 4, 2024

⚠️ No Changeset found

Latest commit: 5d41f58

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

codecov bot commented Nov 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.27%. Comparing base (ffbc13c) to head (5d41f58).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4811   +/-   ##
=======================================
  Coverage   74.27%   74.27%           
=======================================
  Files         101      101           
  Lines        1481     1481           
  Branches      192      192           
=======================================
  Hits         1100     1100           
  Misses        360      360           
  Partials       21       21           
Components Coverage Δ
core 84.61% <ø> (ø)
hooks 77.77% <ø> (ø)
isms 77.77% <ø> (ø)
token 89.01% <ø> (ø)
middlewares 77.58% <ø> (ø)

@daniel-savu daniel-savu changed the title chore: don't crash the relayer if building a chain's cursor fails feat: alert instead of crashing relayer when building cursors Nov 5, 2024
Copy link
Collaborator

@tkporter tkporter left a comment

Choose a reason for hiding this comment

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

I imagine we'll wanna document this in the public docs at some point

@daniel-savu
Copy link
Contributor Author

daniel-savu commented Nov 5, 2024

I imagine we'll wanna document this in the public docs at some point

@tkporter good point, I'll add a quick entry to the relayer monitoring & alerting guide (https://docs.hyperlane.xyz/docs/operate/relayer/monitoring-alerting)

@daniel-savu daniel-savu added this pull request to the merge queue Nov 5, 2024
Merged via the queue into main with commit b72c881 Nov 5, 2024
36 checks passed
@daniel-savu daniel-savu deleted the dan/relayer-crash-fix branch November 5, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants