Skip to content

[vs18.5] Fix ScheduleTimeRecord.AccumulatedTime hang during solution close#13448

Merged
MichalPavlik merged 4 commits intovs18.5from
backport/pr-13375-to-vs18.5
Mar 31, 2026
Merged

[vs18.5] Fix ScheduleTimeRecord.AccumulatedTime hang during solution close#13448
MichalPavlik merged 4 commits intovs18.5from
backport/pr-13375-to-vs18.5

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Mar 25, 2026

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.

YuliiaKovalova and others added 3 commits March 25, 2026 15:40
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 MichalPavlik self-assigned this Mar 25, 2026
Copy link
Copy Markdown
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@MichalPavlik MichalPavlik requested a review from a team as a code owner March 27, 2026 14:42
@MichalPavlik MichalPavlik merged commit cb4e32d into vs18.5 Mar 31, 2026
11 checks passed
@MichalPavlik MichalPavlik deleted the backport/pr-13375-to-vs18.5 branch March 31, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants