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

[Bug]: Canceling msbuild restore is slow when invalid/unreachable source configured #11813

Closed
zivkan opened this issue May 11, 2022 · 0 comments · Fixed by NuGet/NuGet.Client#5631
Assignees
Labels
Functionality:Restore Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Product:dotnet.exe Type:Bug
Milestone

Comments

@zivkan
Copy link
Member

zivkan commented May 11, 2022

NuGet Product Used

MSBuild.exe

Product Version

msbuild 17.2

Worked before?

No response

Impact

It bothers me. A fix would be nice

Repro Steps & Context

  1. Find a solution that does not restore quickly. The longer it takes, the better. For example, try https://github.com/OrchardCMS/OrchardCore
  2. Run dotnet nuget add source https://invalid.nuget.org/v1234/index.json -n invalidSource
  3. Run msbuild -t:restore -v:m
  4. Wait for "error NU1301: Unable to load the service index for source ..." messages start appearing
  5. Press ctrl+C
  6. See that "Attempting to cancel the build" appears immediately, but it can take seconds, or minutes, for the command prompt to return (restore to end), during which time a bunch more NU1301 errors will be reported.

By comparison, if you press ctrl-c quickly after the "Determining projects to restore" message is displayed, the command line returns immeidately. Similarly, when using -p:RestoreUseStaticGraphEvaluation=true, ctrl-c also exits immediately.

Verbose Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:Restore Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Product:dotnet.exe Type:Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants