[vs18.5] Fix ScheduleTimeRecord.AccumulatedTime hang during solution close#13448
Merged
MichalPavlik merged 4 commits intovs18.5from Mar 31, 2026
Merged
[vs18.5] Fix ScheduleTimeRecord.AccumulatedTime hang during solution close#13448MichalPavlik merged 4 commits intovs18.5from
MichalPavlik merged 4 commits intovs18.5from
Conversation
ScheduleTimeRecord.AccumulatedTime throws InternalErrorException with 'Can't get the accumulated time while the timer is still running' during Scheduler.WriteDetailedSummary(). This exception kills the BuildManager work queue, preventing any further build results from being processed. EndBuild() hangs indefinitely, causing VS to freeze for hours. The fix returns the best-effort elapsed time (accumulated + current elapsed) when the timer is still running, instead of throwing. This is diagnostic summary data — throwing has no correctness benefit but causes a catastrophic hang. 11 hits in 30 days confirmed via telemetry (StackHash: 2C721D65...). All occurrences during solution close with running timers.
- Remove placeholder issues/XXXXX URL from XML doc comment - Add ScheduleTimeRecord_AccumulatedTime_DoesNotThrowWhenTimerIsRunning test - Add ScheduleTimeRecord_AccumulatedTime_IncludesPreviousAccumulation test
Co-authored-by: Rainer Sigwald <raines@microsoft.com>
MichalPavlik
approved these changes
Mar 26, 2026
rainersigwald
approved these changes
Mar 26, 2026
Member
rainersigwald
left a comment
There was a problem hiding this comment.
I was going to go through the .NET servicing process for this but I think we don't actually need to, because new 18.5 MSBuilds won't flow anywhere except VS. So I think it's good to merge then go though the VS process.
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.
Work item (Internal use): devdiv2668876
Summary
Internal bookkeeping about phase durations hit a production assert, causing user hangs in VS. We can make the bookkeeping never throw.
ScheduleTimeRecord.AccumulatedTime throws InternalErrorException with
'Can't get the accumulated time while the timer is still running' during
Scheduler.WriteDetailedSummary(). This exception kills the BuildManager
work queue, preventing any further build results from being processed.
EndBuild() hangs indefinitely, causing VS to freeze for hours.
The fix returns the best-effort elapsed time (accumulated + current
elapsed) when the timer is still running, instead of throwing.
This is diagnostic summary data — throwing has no correctness benefit
but causes a catastrophic hang.
Customer Impact
Customers are reporting VS hang during project unload.
Regression?
Yes
Testing
New unit test added.
Risk
Minimal. Removes an exception path entirely. Inaccurate summary times could result but should be strictly better than a hang.