Repository navigation
Reset process state between MSBuild server requests - #14475
Merged
Merged
Conversation
Contributor
|
Hello @copilot, I noticed that you’re changing an .swr file or any file under src/Package/MSBuild.VSSetup.. Please make sure to validate this change by an experimental VS insertion. This is accomplished by pushing to an exp/* branch, which requires write permissions to this repo. |
Co-authored-by: JanProvaznik <[email protected]>
Co-authored-by: JanProvaznik <[email protected]>
Co-authored-by: JanProvaznik <[email protected]>
Co-authored-by: JanProvaznik <[email protected]>
Co-authored-by: JanProvaznik <[email protected]>
Copilot
AI
changed the title
[WIP] Fix process state leaks between server requests
Reset process state between MSBuild server requests
Jul 21, 2026
JanProvaznik
marked this pull request as ready for review
July 21, 2026 11:53
JanProvaznik
approved these changes
Jul 21, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes MSBuild Server request isolation by resetting mutable process state between requests so that a long-lived server node doesn’t leak diagnostics or OS process priority across builds.
Changes:
- Clear per-request deferred logger messages during
ResetBuildState()to prevent duplicated/stale diagnostics and message growth across server requests. - Capture the original process priority before applying
-lowand restore it at the next request boundary. - Add server-reuse regression tests covering deferred-message accumulation and Windows process-priority restoration.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/MSBuild/XMake.cs | Resets per-request deferred logger messages and restores process priority at request boundaries for MSBuild Server reuse. |
| src/MSBuild.UnitTests/MSBuildServer_Tests.cs | Adds regression tests validating deferred messages don’t accumulate across server builds and -low priority does not leak. |
Co-authored-by: Copilot <[email protected]> Copilot-Session: 212b78a7-a261-41ac-8918-1eedd0fbaf94
Enable the Process property function for .NET Framework and assert that the server restores its inherited priority. Co-authored-by: Copilot <[email protected]> Copilot-Session: 212b78a7-a261-41ac-8918-1eedd0fbaf94
AR-May
approved these changes
Jul 27, 2026
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):
Summary
Reusable server processes retained deferred logger messages and
/lowPrioritystate across requests.ResetBuildState().Customer Impact
Prevents duplicate/stale diagnostics, unbounded message accumulation, and normal builds running at inherited low priority.
Regression?
Yes. Mutable process state was not included in the server request reset boundary.
Testing
Added reused-server regressions covering deferred-message accumulation and Windows process-priority restoration.
Risk
Low. Changes are limited to per-request state reset; priority restoration remains best-effort where denied by the OS.