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

refactor(iota-indexer): Do not panic on errors in iota_indexer::framework::runner::run #1701

Merged
merged 6 commits into from
Aug 22, 2024

Conversation

tomxey
Copy link
Contributor

@tomxey tomxey commented Aug 8, 2024

Description of change

Refactored iota_indexer::framework::runner::run to return the errors from handlers instead of panicking, motivated by #1569. Refactored the function to reduce code duplication.

Links to any relevant issues

fix #1569

Type of change

  • Refactor

How the change has been tested

  • cargo test
  • ran the indexer locally and observed that checkpoints are synced without errors

Change checklist

Tick the boxes that are relevant to your changes, and delete any items that are not.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have checked that new and existing unit tests pass locally with my changes

@tomxey tomxey self-assigned this Aug 8, 2024
@lzpap lzpap added the infrastructure Issues related to the Infrastructure Team label Aug 9, 2024
@tomxey tomxey force-pushed the sc-platform/handle-errors-in-indexer-runner branch from b582950 to b79d712 Compare August 14, 2024 07:35
@tomxey tomxey changed the title refactor(iota-indexer): Handle errors in iota_indexer::framework::runner::run refactor(iota-indexer): Do not panic on errors in iota_indexer::framework::runner::run Aug 14, 2024
@tomxey tomxey force-pushed the sc-platform/handle-errors-in-indexer-runner branch from b79d712 to 8fe9450 Compare August 14, 2024 07:42
@tomxey tomxey force-pushed the sc-platform/handle-errors-in-indexer-runner branch from 8fe9450 to 5ea3777 Compare August 14, 2024 09:33
@tomxey tomxey marked this pull request as ready for review August 14, 2024 10:08
@tomxey tomxey requested review from a team as code owners August 14, 2024 10:08
Copy link
Contributor

@sergiupopescu199 sergiupopescu199 left a comment

Choose a reason for hiding this comment

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

I've spotted an unwrap in the run function

@sergiupopescu199 sergiupopescu199 requested review from a team August 14, 2024 12:05
Copy link
Member

@samuel-rufi samuel-rufi left a comment

Choose a reason for hiding this comment

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

Looks good! Only minor suggestion to fix rustfmt and the typo you mentioned above.

@tomxey
Copy link
Contributor Author

tomxey commented Aug 19, 2024

I've spotted an unwrap in the run function

@sergiupopescu199 I skipped it since it seemed to not be in scope of #1569

@tomxey
Copy link
Contributor Author

tomxey commented Aug 19, 2024

Looks good! Only minor suggestion to fix rustfmt and the typo you mentioned above.

@samuel-rufi Done

Copy link
Member

@samuel-rufi samuel-rufi left a comment

Choose a reason for hiding this comment

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

Seems like clippy is failing the CI check

Copy link
Contributor

@kodemartin kodemartin left a comment

Choose a reason for hiding this comment

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

Hey @tomxey looks good. Let just a few suggestions to improve the patch.

Plus, mind clippy.

crates/iota-indexer/src/framework/runner.rs Outdated Show resolved Hide resolved
crates/iota-indexer/src/framework/runner.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@kodemartin kodemartin left a comment

Choose a reason for hiding this comment

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

lgtm 🐻‍❄️

@tomxey tomxey merged commit 3caf0cc into develop Aug 22, 2024
39 of 42 checks passed
@tomxey tomxey deleted the sc-platform/handle-errors-in-indexer-runner branch August 22, 2024 14:06
marc2332 pushed a commit that referenced this pull request Aug 23, 2024
alexsporn pushed a commit that referenced this pull request Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Issues related to the Infrastructure Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task (Infrastructure)]: Handle errors in iota_indexer::framework::runner::run
5 participants