-
Notifications
You must be signed in to change notification settings - Fork 97
fix(conductor): increase retries in case ingress restarts #2270
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,7 @@ use tower::{ | |
| ServiceExt as _, | ||
| }; | ||
| use tracing::{ | ||
| debug, | ||
| info, | ||
| instrument, | ||
| warn, | ||
|
|
@@ -294,7 +295,7 @@ async fn fetch_commit_with_retry( | |
| ) -> Result<VerificationResponse, VerificationMetaError> { | ||
| let retry_config = RetryFutureConfig::new(u32::MAX) | ||
| .custom_backoff(CometBftRetryStrategy::new(Duration::from_millis(100))) | ||
| .max_delay(Duration::from_secs(10)) | ||
| .max_delay(Duration::from_secs(300)) | ||
| .on_retry( | ||
| |attempt: u32, next_delay: Option<Duration>, error: &tendermint_rpc::Error| { | ||
| let wait_duration = next_delay | ||
|
|
@@ -329,7 +330,7 @@ async fn fetch_validators_with_retry( | |
| ) -> Result<VerificationResponse, VerificationMetaError> { | ||
| let retry_config = RetryFutureConfig::new(u32::MAX) | ||
| .custom_backoff(CometBftRetryStrategy::new(Duration::from_millis(100))) | ||
| .max_delay(Duration::from_secs(10)) | ||
| .max_delay(Duration::from_secs(300)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: hard-coded 300s (5min) max delay should be configurable via environment variable, similar to other timeout values in the codebase that have Context Used: Rule from Prompt To Fix With AIThis is a comment left during a code review.
Path: crates/astria-conductor/src/celestia/verify.rs
Line: 333:333
Comment:
**style:** hard-coded 300s (5min) max delay should be configurable via environment variable, similar to other timeout values in the codebase that have `XXX: This should probably be configurable` comments
**Context Used:** Rule from `dashboard` - Hard-coded values that may vary between different networks (local, mocha, mainnet) should be configu... ([source](https://app.greptile.com/review/custom-context?memory=3a7f89a9-1179-4b2d-b733-e3acbebacdde))
How can I resolve this? If you propose a fix, please make it concise. |
||
| .on_retry( | ||
| |attempt: u32, next_delay: Option<Duration>, error: &tendermint_rpc::Error| { | ||
| let wait_duration = next_delay | ||
|
|
@@ -382,6 +383,10 @@ impl<'a> BackoffStrategy<'a, tendermint_rpc::Error> for CometBftRetryStrategy { | |
| self.delay = self.delay.saturating_mul(2); | ||
| RetryPolicy::Delay(prev_delay) | ||
| } else { | ||
| debug!( | ||
| error = error as &dyn std::error::Error, | ||
| "not retrying failed request to CometBFT; error is not retryable", | ||
| ); | ||
| RetryPolicy::Break | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: hard-coded 300s (5min) max delay should be configurable via environment variable, similar to other timeout values in the codebase that have
XXX: This should probably be configurablecommentsContext Used: Rule from
dashboard- Hard-coded values that may vary between different networks (local, mocha, mainnet) should be configu... (source)Prompt To Fix With AI