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

[RSDK-9643] ota download timeout #373

Merged
merged 7 commits into from
Jan 7, 2025

Conversation

mattjperez
Copy link
Member

No description provided.

@mattjperez mattjperez requested a review from a team as a code owner January 7, 2025 18:13
file_len
);
}
Ok(None) => break,
Copy link
Member Author

Choose a reason for hiding this comment

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

any issues with an incomplete download should still be caught by the nwritten != content_len check after this scope

@mattjperez mattjperez self-assigned this Jan 7, 2025
.map_err(FrameError::Network)
.or(async {
async_io::Timer::after(Duration::from_secs(FRAME_TIMEOUT_SECS)).await;
Err(FrameError::Timeout(FRAME_TIMEOUT_SECS as usize))
Copy link
Member Author

Choose a reason for hiding this comment

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

the goal is to timeout if a single frame is unresponsive for more than 30seconds, unblocking the caller (ConfigMonitor) so it can try again completely in 10 seconds (ConfigMonitor's default period)

Copy link
Member

@gvaradarajan gvaradarajan left a comment

Choose a reason for hiding this comment

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

LGTM, with optional suggestion

@@ -120,6 +123,15 @@ pub(crate) enum ConfigError {
Other(String),
}

/// used to differentiate between no-frame and a timeout
#[derive(Error, Debug)]
pub(crate) enum FrameError {
Copy link
Member

Choose a reason for hiding this comment

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

DownloadError instead of FrameError?

Copy link
Member

@acmorrow acmorrow left a comment

Choose a reason for hiding this comment

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

LGTM

@mattjperez mattjperez merged commit 249f2eb into viamrobotics:main Jan 7, 2025
6 checks passed
@mattjperez mattjperez deleted the rsdk-ota-download-timeout branch January 7, 2025 20:15
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.

3 participants