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]: NuGetSdkResolver does not support being called in parallel #11443

Open
jeffkl opened this issue Dec 9, 2021 · 0 comments
Open

[Bug]: NuGetSdkResolver does not support being called in parallel #11443

jeffkl opened this issue Dec 9, 2021 · 0 comments
Labels
Priority:2 Issues for the current backlog. Product:MSBuildSDKResolver The NuGet powered SDK resolver. Owned by MSBuild team Type:Bug

Comments

@jeffkl
Copy link
Contributor

jeffkl commented Dec 9, 2021

NuGet Product Used

MSBuild.exe

Product Version

All

Worked before?

No response

Impact

It's more difficult to complete my work

Repro Steps & Context

The MSBuild SDK resolution APIs can call SDK resolvers multiple times in parallel for each unique SDK. They can also call an SDK resolver for the same SDK if its part of two different builds (which happens in Visual Studio).

The NuGetSdkResolver should be updated to take into account that it can be called on different threads for the one or more SDKs.

Epic: #11441

Verbose Logs

No response

@jeffkl jeffkl added Priority:2 Issues for the current backlog. Type:Bug Product:MSBuildSDKResolver The NuGet powered SDK resolver. Owned by MSBuild team Category:Customer Sprint Triage:Untriaged labels Dec 9, 2021
@jeffkl jeffkl self-assigned this Dec 9, 2021
@nkolev92 nkolev92 added this to the Sprint 2021-12 milestone Dec 13, 2021
jeffkl added a commit to NuGet/NuGet.Client that referenced this issue Dec 17, 2021
The MSBuild SDK resolver APIs provide some state but it is not thread-safe.  This results in the NuGet SDK resolver loading and parsing global.json N times in Visual Studio, once for solution load and once for every design time build.

This change introduces a file cache based on path and last write time that is thread-safe.

I also changed how global.json is parsed to help speed up the process.

Fixes NuGet/Home#11443
jeffkl added a commit to NuGet/NuGet.Client that referenced this issue Jan 3, 2022
The MSBuild SDK resolver APIs provide some state but it is not thread-safe.  This results in the NuGet SDK resolver loading and parsing global.json N times in Visual Studio, once for solution load and once for every design time build.

This change introduces a file cache based on path and last write time that is thread-safe.

I also changed how global.json is parsed to help speed up the process.

Fixes NuGet/Home#11450
Related to NuGet/Home#11443
@jeffkl jeffkl modified the milestones: Sprint 2021-12, Sprint 2022-01 Jan 3, 2022
jeffkl added a commit to NuGet/NuGet.Client that referenced this issue Jan 12, 2022
The MSBuild SDK resolver APIs provide some state but it is not thread-safe.  This results in the NuGet SDK resolver loading and parsing global.json N times in Visual Studio, once for solution load and once for every design time build.

This change introduces a file cache based on path and last write time that is thread-safe.

I also changed how global.json is parsed to help speed up the process.

Fixes NuGet/Home#11450
Related to NuGet/Home#11443
jeffkl added a commit to NuGet/NuGet.Client that referenced this issue Feb 2, 2022
The MSBuild SDK resolver APIs provide some state but it is not thread-safe.  This results in the NuGet SDK resolver loading and parsing global.json N times in Visual Studio, once for solution load and once for every design time build.

This change introduces a file cache based on path and last write time that is thread-safe.

I also changed how global.json is parsed to help speed up the process.

Fixes NuGet/Home#11450
Related to NuGet/Home#11443
@jeffkl jeffkl modified the milestones: Sprint 2022-01, Sprint 2022-02 Feb 7, 2022
@jeffkl jeffkl added the Category:Quality Week Issues that should be considered for quality week label Feb 28, 2022
@jeffkl jeffkl modified the milestones: Sprint 2022-02, Sprint 2022-03 Feb 28, 2022
@jeffkl jeffkl modified the milestones: Sprint 2022-02, Sprint 2022-03 Mar 7, 2022
@jeffkl jeffkl modified the milestones: Sprint 2022-03, Sprint 2022-04 Apr 4, 2022
@aortiz-msft aortiz-msft modified the milestones: Sprint 2022-04, Sprint 2022-05 Apr 25, 2022
@nkolev92 nkolev92 removed this from the Sprint 2022-05 milestone May 3, 2022
@jeffkl jeffkl removed the Category:Quality Week Issues that should be considered for quality week label Nov 4, 2024
@jeffkl jeffkl removed their assignment Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:2 Issues for the current backlog. Product:MSBuildSDKResolver The NuGet powered SDK resolver. Owned by MSBuild team Type:Bug
Projects
None yet
Development

No branches or pull requests

4 participants