-
Notifications
You must be signed in to change notification settings - Fork 4
fix(extractor/solana): properly handle partially downloaded OF1 files #1511
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
Conversation
LNSD
left a comment
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.
LGTM ✅
| match num_retries { | ||
| 0 => { | ||
| // First error, make sure it is visible in info (default) logs. | ||
| num_retries += 1; | ||
| tracing::info!(block = %current_block, error = %e, "Block streaming failed, retrying"); | ||
| tokio::time::sleep(DEBUG_RETRY_DELAY).await; | ||
| } | ||
| 1..DEBUG_RETRY_LIMIT => { | ||
| num_retries += 1; | ||
| tracing::debug!(block = %current_block, error = %e, "Block streaming failed, retrying"); | ||
| tokio::time::sleep(DEBUG_RETRY_DELAY).await; | ||
| } | ||
| DEBUG_RETRY_LIMIT..WARN_RETRY_LIMIT => { | ||
| num_retries += 1; | ||
| tracing::warn!(block = %current_block, error = %e, "Block streaming failed, retrying"); | ||
| tokio::time::sleep(WARN_RETRY_DELAY).await; | ||
| } | ||
| _ => { | ||
| tracing::error!(block = %current_block, error = %e, "Block streaming failed, retrying"); | ||
| tokio::time::sleep(ERROR_RETRY_DELAY).await; | ||
| } |
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.
In the logs, next to the error field, I would add the error_source = logging::error_source(&e) for more context.
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.
| let start = std::time::Instant::now(); | ||
| let response = reqwest::get(&car_file_url).await?; | ||
| let status = response.status(); | ||
| let action = match std::fs::metadata(dest).map(|meta| meta.len()) { |
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.
I would recommend using fs_err instead of std::fs. It has superior error reporting.
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.
- If an error occurs while downloading an OF1 CAR file, the next time the extractor runs should resume the file download. This commit adds that logic.
ebb2f14 to
902c3c0
Compare
If an error occurs while downloading an OF1 CAR file, the next time the extractor runs should resume the file download. This commit adds that logic.
This bug was discovered while testing Solana full sync.