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

Update Microsoft Store service to allow callers to set their own package install timeout #3897

Merged

Conversation

bbonaby
Copy link
Contributor

@bbonaby bbonaby commented Sep 24, 2024

Summary of the pull request

Now that the Wsl extension uses the Microsoft store service in Dev Home to download and install Wsl distributions. I noticed from some of the telemetry and a failure I was getting that the Microsoft Store service has an arbitrary timeout of 1 minute. A download and install of an app could take longer than a minute especially if there are other updates happening that makes the download go to the pending state.

The Microsoft Store Service in Dev Home uses this

References and relevant issues

Detailed description of the pull request / Additional comments

Validation steps performed

PR checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated

@@ -82,17 +81,11 @@ public async Task<bool> TryInstallPackageAsync(string packageId)
{
var installTask = InstallPackageAsync(packageId);

// Wait for a maximum of StoreInstallTimeout (60 seconds).
var completedTask = await Task.WhenAny(installTask, Task.Delay(_storeInstallTimeout));
await installTask;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could this go forever? Is there a benefit to removing the timeout vs making it longer?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah timeout sounds good, especially since user can't cancel the operation.

Copy link
Contributor Author

@bbonaby bbonaby Sep 28, 2024

Choose a reason for hiding this comment

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

Interestingly, everywhere I looked in ADO I didn't see anyone using a timeout but I'm cool with having one. What I did was just creat a new method that allowed callers to pass in their own timeout. Then moved the function body (everything within the try) into that method. Then called it from within TryInstallPackageAsync. I did this to allow the exception to bubble up to callers if they would like that behavior e.g the wslExtension would.

@bbonaby bbonaby changed the title Remove store timeout from Microsoft Store service Update Microsoft Store service to allow callers to set their own package install timeout Sep 28, 2024
@bbonaby bbonaby merged commit 8cc7492 into main Oct 1, 2024
4 checks passed
@krschau krschau added this to the Dev Home v0.19 milestone Oct 2, 2024
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.

5 participants