Skip to content

Workflow improvements to increase winget command success rate#648

Merged
yao-msft merged 10 commits into
microsoft:masterfrom
yao-msft:improvesuccessrates
Nov 26, 2020
Merged

Workflow improvements to increase winget command success rate#648
yao-msft merged 10 commits into
microsoft:masterfrom
yao-msft:improvesuccessrates

Conversation

@yao-msft

@yao-msft yao-msft commented Nov 21, 2020

Copy link
Copy Markdown
Contributor

Change

  • Check IAttachementExecute:Save() result instead of ignoring and give better output message
  • Make source update failure not blocking during source open for winget install, upgrade, etc
  • Make the synchronization lock accept WAIT_ABANDON since we always write everything back
  • In downloader.cpp, check download size matches content-length to detect corrupt downloads if possible
  • Retry for installer downloads and manifest downloads
  • Make ERROR_NO_RANGES_PROCESSED error more specific when connection failed

Validation

Existing tests. Manual verification by installing several apps succeeded.

Microsoft Reviewers: Open in CodeFlow

@yao-msft yao-msft requested a review from a team as a code owner November 21, 2020 05:51
if (e.code() == HRESULT_FROM_WIN32(ERROR_NO_RANGES_PROCESSED) ||
HRESULT_FACILITY(e.code()) == FACILITY_HTTP)
{
// Server does not support range request, use download

@ranm-msft ranm-msft Nov 26, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

support range request [](start = 35, length = 21)

update comment #Resolved

auto result = context.Reporter.ExecuteWithProgress(std::bind(Repository::OpenSource, sourceName, std::placeholders::_1), true);
source = result.Source;

for (const auto& s : result.SourcesWithUpdateFailure)

@ranm-msft ranm-msft Nov 26, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

for [](start = 12, length = 3)

add a comment indicating that this is only going to produce a warning but we'll continue with the operation (install/update etc.) #Resolved

// Check download size matches if content length is provided in response header
if (contentLength > 0)
{
THROW_HR_IF(E_UNEXPECTED, bytesDownloaded != contentLength);

@ranm-msft ranm-msft Nov 26, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

E_UNEXPECTED [](start = 24, length = 12)

let's create a new hresult reflecting the actual error of size mismatch
DOWNLOAD_SIZE_MISMATCH #Resolved

aesThread.join();

AICLI_LOG(Core, Info, << "Finished applying motw using IAttachmentExecute. Result: " << hr);
AICLI_LOG(Core, Info, << "Finished applying motw using IAttachmentExecute. Result: " << hr << " AES Save result: " << aesSaveResult);

@ranm-msft ranm-msft Nov 26, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AES [](start = 104, length = 3)

let's say "Attachment Execution Service" #Resolved

@ranm-msft ranm-msft left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:shipit:

@yao-msft yao-msft merged commit 92b3e73 into microsoft:master Nov 26, 2020
@yao-msft yao-msft deleted the improvesuccessrates branch November 26, 2020 03:29
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