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

Iotedge Check: Timeout for aka.ms latest version http request #6937

Merged
merged 1 commit into from
Mar 7, 2023

Conversation

and-rewsmith
Copy link
Contributor

@and-rewsmith and-rewsmith commented Mar 2, 2023

Implement timeout feature for iotedge latest version check. Tested manually. Example of failure:

Configuration checks
--------------------
√ aziot-edged configuration is well-formed - OK
√ configuration up-to-date with config.toml - OK
√ container engine is installed and functional - OK
× configuration has correct URIs for daemon mgmt endpoint - Error
    Unable to find image 'mcr.microsoft.com/azureiotedge-diagnostics:1.4.920230303.5' locally
    docker: Error response from daemon: manifest for mcr.microsoft.com/azureiotedge-diagnostics:1.4.920230303.5 not found: manifest unknown: manifest tagged by "1.4.920230303.5" is not found.
    See 'docker run --help'.
× aziot-edge package is up-to-date - Error
    Error while fetching latest versions of edge components: HTTP request timed out
× container time is close to host time - Error
    Could not query local time inside container

Azure IoT Edge PR checklist:

This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines and Best Practices

  • I have read the contribution guidelines.
  • Title of the pull request is clear and informative.
  • Description of the pull request includes a concise summary of the enhancement or bug fix.

Testing Guidelines

  • Pull request includes test coverage for the included changes.
  • Description of the pull request includes
    • concise summary of tests added/modified
    • local testing done.

Draft PRs

  • Open the PR in Draft mode if it is:
    • Work in progress or not intended to be merged.
    • Encountering multiple pipeline failures and working on fixes.

Note: We use the kodiakhq bot to merge PRs once the necessary checks and approvals are in place. When it merges a PR, kodiakhq converts the PR title to the commit title, PR description to the commit description, and squashes all the commits in the PR to a single commit. The net effect is that entire PR becomes a single commit. Please follow the best practices mentioned here for the PR title and description

@and-rewsmith and-rewsmith force-pushed the andsmi/1.4-timeout-akams branch from e952a95 to d8ff361 Compare March 3, 2023 23:45
use anyhow::{anyhow, Context};
use regex::Regex;

use crate::check::{Check, CheckResult, Checker, CheckerMeta};
use crate::error::{Error, FetchLatestVersionsReason};

const AKA_MS_HTTP_REQUEST_TIMEOUT: Duration = Duration::from_secs(300);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This may need to be lower. @damonbarry / @micahl What do you recommend?

Copy link
Member

Choose a reason for hiding this comment

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

Honestly I think this is fine. It's a last resort, doesn't need to be super snappy IMO.

@and-rewsmith and-rewsmith marked this pull request as ready for review March 3, 2023 23:48
@and-rewsmith and-rewsmith requested a review from damonbarry March 3, 2023 23:48
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.

2 participants