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

NuGet should not retry HTTP requests on 401 unauthorized or 403 access denied responses from private feeds #12981

Open
kartheekp-ms opened this issue Oct 31, 2023 · 0 comments
Labels
Area:Authentication Functionality:Restore Functionality:SDK The NuGet client packages published to nuget.org Functionality:Search Functionality:VisualStudioUI Partner:VS-Other Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Product:dotnet.exe Product:NuGet.exe NuGet.exe Type:DCR Design Change Request

Comments

@kartheekp-ms
Copy link
Contributor

kartheekp-ms commented Oct 31, 2023

NuGet Product(s) Affected

NuGet.exe, Visual Studio Package Management UI, Visual Studio Package Manager Console, MSBuild.exe, dotnet.exe, NuGet SDK

Current Behavior

In the NuGet Client repository, when NuGet attempts to fetch a service index for a feed and the server responds with a 401 unauthorized message or 403 access denied message, the current implementation unnecessarily retries the request. Specifically, if enhanced retry is enabled (which seems to be the default setting), the request is retried 5 times. Otherwise, it's retried 2 times.

Desired Behavior

The HttpSourceAuthenticationHandler already has its own retry logic if credentials are required to access a private feed. Therefore, retrying an additional 5 times won't change the feed's response and only adds unnecessary load to private feed servers. I propose that we eliminate retries when a private feed response returns a 401 unauthorized or 403 access denied error.

Additional Context

No response

@jeffkl jeffkl added the Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. label Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:Authentication Functionality:Restore Functionality:SDK The NuGet client packages published to nuget.org Functionality:Search Functionality:VisualStudioUI Partner:VS-Other Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Product:dotnet.exe Product:NuGet.exe NuGet.exe Type:DCR Design Change Request
Projects
None yet
Development

No branches or pull requests

3 participants