-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix concurrent tool restore and version range error #35884
Merged
wtgodbe
merged 2 commits into
dotnet:release/8.0.1xx
from
JL03-Yue:fix-concurrent-tool-restore
Oct 6, 2023
Merged
Fix concurrent tool restore and version range error #35884
wtgodbe
merged 2 commits into
dotnet:release/8.0.1xx
from
JL03-Yue:fix-concurrent-tool-restore
Oct 6, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dotnet-issue-labeler
bot
added
Area-Tools
untriaged
Request triage from a team member
labels
Oct 5, 2023
JL03-Yue
changed the title
Fix concurrent tool restore
Fix concurrent tool restore and version range error
Oct 5, 2023
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
dsplaisted
approved these changes
Oct 6, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Approved over email |
1 task
fixes #35999 |
This was referenced Oct 23, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Customer Impact
In .NET 8 we made a breaking change that changes the current .NET tool installation mechanism from restore a local temporary project to downloading the .NET tool from NuGet. This change was introduced because this previous mechanism has number of side effects, often show up as flaky restore errors because MSBuild concepts like Directory.Build.props, or other heirarchical notions, pollute the restore.
The change, however, affect the behavior in tool restore. For one, the change in tool install affect the parallel tool restore as it might read multiple too info into the same config file. For another, the change of getting tool's version tries to read from a property
.originalString
that might not exist.The intended way to fix this is to make the parallel tool restore sequential, and to get rid of reading the
.originalString
property. To make the tool restore sequential, instead of usingAsParallel()
in the code, the updated code usesAsEnumerate()
to reduce the chance of error. For version, this pull request adds a condition to check if theversionRange
passed in is null and set it to a default value.Both changes are validated by tests.
Testing
Existing unit tests passed without changes. New tested are added to validate tool restore returns the correct version, and tool restore is able to restore multiple tools. The new testing scenarios pass with changes in the pull request.
Risk
Low. This change resolves some errors caused by breaking change by add conditions to set the
versionRange
and make parallel tool restore sequential, without adding complexity to the behavior.Current unit tests passed without changes, and new tests are added to validate the change. Even though making parallel tool restore sequential might reduce the speed of tool restore, this is a validate approach because it reduces the risk of issues from concurrent restoration.
Original description
Referred to Add known issue for .NET tool restore in .NET 8 RC2