Fix nomination hang during project rename#7435
Draft
nkolev92 wants to merge 2 commits into
Draft
Conversation
Add timeout to the !isAllProjectsNominated branch in the restore drain loop. If no nominations arrive within BulkRestoreCoordinationTimeout (5 minutes), break and proceed with restore using available data. This prevents permanent hangs when a project's cache entry is wiped and no recovery nomination can arrive. Preserve ProjectRestoreInfoSource across project renames so that future restore cycles can properly coordinate via HasPendingNomination. Previously, OnEnvDTEProjectRenamed destroyed the entire cache entry including the source registration, which was never re-registered. Fixes: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1618509 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or 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
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.
Bug
Fixes: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1618509
Description
A project rename in Visual Studio causes a permanent hang because NuGet's
ProjectSystemCacheloses a project'sProjectRestoreInfoduring the rename, and no recovery path exists. TheSolutionRestoreWorkerdrain loop polls indefinitely at 400ms intervals becauseIsAllProjectsNominatedAsync()can never returntrueagain.Changes
Timeout in the
!isAllProjectsNominatedbranch (SolutionRestoreWorker.cs): If no nominations arrive withinBulkRestoreCoordinationTimeout(5 minutes) since the last received nomination, break the drain loop and proceed with restore. This prevents permanent hangs when a project's cache entry is wiped and no recovery nomination can arrive. Uses the existingImplicitRestoreReason.NominationsIdleTimeouttelemetry reason.Preserve
ProjectRestoreInfoSourceacross renames (VSSolutionManager.cs,ProjectSystemCache.cs,IProjectSystemCache.cs): Before removing a project from the cache during rename, retrieve itsProjectRestoreInfoSourceand re-register it on the new cache entry. This ensures future restore cycles can properly coordinate viaHasPendingNomination. AddedTryGetProjectRestoreInfoSourcetoIProjectSystemCache.PR Checklist