Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Retry block_pointer_from_number on deploy #4812

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

mangas
Copy link
Contributor

@mangas mangas commented Aug 21, 2023

Add retry to avoid a single failure while making the call prevent the subsgraph from being deployed Add warning for failed attempts

Closes #4724

@mangas mangas marked this pull request as ready for review August 21, 2023 14:11
@mangas mangas force-pushed the filipe/retry-block-number-on-deployment branch from 1742b25 to e32f7fc Compare August 21, 2023 14:26
@mangas mangas requested a review from neysofu August 21, 2023 17:59
Comment on lines 539 to 555
fn retry_strategy(limit_opt: Option<usize>) -> Box<dyn Iterator<Item = Duration> + Send> {
// Exponential backoff, but with a maximum
let max_delay_ms = 30_000;
let backoff = ExponentialBackoff::from_millis(2)
.max_delay(Duration::from_millis(max_delay_ms))
.map(jitter);

// Apply limit (maximum retry count)
match limit_opt {
Some(limit) => {
// Items are delays *between* attempts,
// so subtract 1 from limit.
Box::new(backoff.take(limit - 1))
}
None => Box::new(backoff),
}
}
Copy link
Member

Choose a reason for hiding this comment

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

This looks identical to graph::util::futures::retry_strategy, correct? If so, we can make that public and reuse it here, and also avoid pub use tokio_retry.

Add retry to avoid a single failure while making the call prevent the subsgraph from being deployed
Add warning for failed attempts
@mangas mangas force-pushed the filipe/retry-block-number-on-deployment branch from e32f7fc to dfb4dd0 Compare August 22, 2023 07:05
@mangas mangas merged commit 0d49f14 into master Aug 22, 2023
@mangas mangas deleted the filipe/retry-block-number-on-deployment branch August 22, 2023 11:20
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Spurious issue with subgraph deployments
2 participants