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

fix: give indexer some time to catch up before failing on restart #792

Merged
merged 6 commits into from
Aug 4, 2024

Conversation

ppca
Copy link
Contributor

@ppca ppca commented Aug 1, 2024

No description provided.

@ppca ppca requested review from volovyks and ChaoticTempest August 1, 2024 18:37
@@ -324,7 +328,7 @@ pub fn run(
anyhow::Ok(lake)
}) else {
tracing::error!(?options, "indexer failed to build");
backoff(i);
backoff(i, 1, 120);
Copy link
Member

Choose a reason for hiding this comment

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

Seems i will never decrease, and eventually i will become max if indexer keep working. Do we need to restore it to a small number on a not failing case?

@@ -584,6 +584,7 @@ impl VersionedMpcContract {
#[near_bindgen]
impl VersionedMpcContract {
#[handle_result]
#[init(ignore_state)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need this change? Not sure if it's safe.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah sorry. shouldn't have pushed this.

@ppca ppca force-pushed the xiangyi/mainnet_sleep branch from af90fba to 867eb20 Compare August 2, 2024 20:39
Comment on lines +356 to +359
if i > 0 {
// give it some time to catch up
backoff(i, 10, 300);
}
Copy link
Member

Choose a reason for hiding this comment

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

we could've just had a flat sleep(5mins) here instead of modifying backoff

@ppca ppca merged commit eb05c22 into develop Aug 4, 2024
3 checks passed
@ppca ppca deleted the xiangyi/mainnet_sleep branch August 4, 2024 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants