Enhance crash dump collection options in RemoteExecutor (release/10.0)#17060
Draft
hoyosjs wants to merge 1 commit into
Draft
Enhance crash dump collection options in RemoteExecutor (release/10.0)#17060hoyosjs wants to merge 1 commit into
hoyosjs wants to merge 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR ports the “enhance crash dump collection options in RemoteExecutor” feature to release/10.0, adding configurable crash-dump behavior for RemoteExecutor subprocesses and modernizing timeout diagnostics (including updated diagnostic dependencies required on this branch).
Changes:
- Adds
CrashDumpCollectionType,CrashDumpPath, andEnableTimeoutDumpCollectionoptions to control crash-dump environment variables and timeout dump behavior. - Refactors timeout diagnostics to use
DiagnosticsClient.WriteDumpon .NET (Core) and CLRMD v4 thread enumeration, while keeping the legacyMiniDumppath for .NET Framework. - Updates package versions (CLRMD upgrade + new NETCore.Client) and adds tests validating crash-dump env-var behavior and dump creation.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Directory.Packages.props | Updates central package versions; adds Microsoft.Diagnostics.NETCore.Client and upgrades CLRMD to v4. |
| eng/Versions.props | Bumps SystemMemoryVersion to satisfy upgraded dependency requirements. |
| src/Microsoft.DotNet.RemoteExecutor/src/RemoteExecutor.cs | Sets/removes DOTNET_Dbg* env vars based on new RemoteInvokeOptions crash-dump settings. |
| src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeHandle.cs | Adds EnableTimeoutDumpCollection gate and refactors timeout dump + thread diagnostics using DiagnosticsClient/CLRMD v4. |
| src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeOptions.cs | Introduces crash-dump configuration API surface (CrashDumpCollectionType, CrashDumpPath, EnableTimeoutDumpCollection). |
| src/Microsoft.DotNet.RemoteExecutor/src/Microsoft.DotNet.RemoteExecutor.csproj | Adds NETCore.Client dependency (netcore only), removes MiniDump.cs from netcore compilation, and applies scoped VersionOverrides. |
| src/Microsoft.DotNet.RemoteExecutor/tests/RemoteExecutorTests.cs | Adds tests for crash-dump env-var behavior and dump creation on crash. |
| src/Microsoft.DotNet.RemoteExecutor/tests/Microsoft.DotNet.RemoteExecutor.Tests.csproj | Mirrors scoped VersionOverrides to keep test restore graph consistent with src project. |
Comment on lines
+214
to
+220
| try | ||
| { | ||
| string dumpPath = Path.Combine(uploadPath, $"{Process.Id}.{Path.GetRandomFileName()}.dmp"); | ||
| #if NETCOREAPP | ||
| // These define guards assume that harness running on .NET Framework implies test process runs on .NET Framework. | ||
| var client = new DiagnosticsClient(Process.Id); | ||
| client.WriteDump(DumpType.WithHeap, dumpPath, logDumpGeneration: false); |
Comment on lines
+246
to
+247
| string[] dumpFiles = Directory.GetFiles(dumpDir, "*.dmp"); | ||
| Assert.NotEmpty(dumpFiles); |
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.
Summary
This is the release/10.0 port of #16716 ("Enhance crash dump collection options in RemoteExecutor"). It is an adaptation, not a cherry-pick:
release/10.0ships older dependencies, so the CLRMD upgrade required additional dependency handling.The feature adds env-var-based crash dump control plus improved timeout-diagnostics dump collection to
Microsoft.DotNet.RemoteExecutor:CrashDumpCollectionTypeenum andEnableTimeoutDumpCollection/CrashDumpCollectionType/CrashDumpPathoptions onRemoteInvokeOptions.DOTNET_DbgEnableMiniDump,DOTNET_DbgMiniDumpType,DOTNET_DbgMiniDumpName) inRemoteExecutor.CollectTimeoutDiagnosticsusingMicrosoft.Diagnostics.NETCore.ClientDiagnosticsClient.WriteDumpon .NET Core, plus CLRMD v4 thread enumeration; the legacyMiniDump.cspath remains for .NET Framework.Key difference from main
On
main, CLRMD (Microsoft.Diagnostics.Runtime) was already v4. Onrelease/10.0it was still1.0.5, so this PR performs the CLRMD 1.0.5 → 4.0.732101 upgrade and addsMicrosoft.Diagnostics.NETCore.Client0.2.721401.Review-feedback fixes (same as main)
RemoteExecutor.cs—DOTNET_DbgMiniDumpTypeformatted withCultureInfo.InvariantCulture.RemoteInvokeHandle.cs— timeout dump usesDumpType.WithHeap(notFull).RemoteExecutorTests.cs—CrashDumpCollection_DefaultLeavesEnvVarsUntouchedis now deterministic: it sets knownDOTNET_Dbg*values onoptions.StartInfo.Environmentand asserts the child observes the same values (passthrough).Intentionally excluded
The unrelated
DefaultIdentityTokenCredential.cs/ Managed Identity change from the source branch (which would require an Azure.Identity central bump) is not ported — it is unrelated to crash dumps.Files changed
Directory.Packages.propseng/Versions.propssrc/Microsoft.DotNet.RemoteExecutor/src/RemoteExecutor.cssrc/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeHandle.cssrc/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeOptions.cssrc/Microsoft.DotNet.RemoteExecutor/src/Microsoft.DotNet.RemoteExecutor.csprojsrc/Microsoft.DotNet.RemoteExecutor/tests/RemoteExecutorTests.cssrc/Microsoft.DotNet.RemoteExecutor/tests/Microsoft.DotNet.RemoteExecutor.Tests.csprojRisk assessment
Central package changes (
Directory.Packages.props/eng/Versions.props)Minimal, and all are needed by RemoteExecutor's CLRMD/NETCore.Client upgrade:
Microsoft.Diagnostics.RuntimeMicrosoft.Diagnostics.NETCore.ClientDiagnosticsClient.WriteDumpon .NET Core. RemoteExecutor-exclusive.System.Collections.ImmutableMicrosoft.Bcl.AsyncInterfacesSystemMemoryVersion(eng/Versions.props)System.Collections.Immutable10.0.7.These do not leak the .NET-10-final stack into netfx build tasks: the netfx build-task packages keep their 8.0.x pins via
Update=entries ineng/BuildTask.Packages.props, and CLRMD/NETCore.Client are consumed only by RemoteExecutor.Isolated
VersionOverride(scoped to the 2 RemoteExecutor projects only)CLRMD 4.x transitively requires
Azure.Identity ≥ 1.21.0 → Azure.Core ≥ 1.53.0, which pulls the10.0.xSystem.Text.Json / Encodings.Web / Bcl.AsyncInterfaces / Extensions.* andMicrosoft.Identity.Client 4.83.1. Rather than bumping these central versions repo-wide (which would push the 10.0.x stack into 5 unrelated consumers — Build.Tasks.Feed, ArcadeAzureIntegration, Helix.Client, Helix.JobSender, Internal.SymbolHelper — and risk netfx build-task binding-redirect load failures), they are pinned locally viaVersionOverrideon directPackageReferences in only the src and tests csproj. Minimum versions that produce a clean restore were chosen (Azure.Identity 1.21.0, Azure.Core 1.53.0, etc.), not main's latest.Blast radius
eng/BuildTask.Packages.propsare unchanged; no build task picks up the 10.0.x stack.DefaultIdentityTokenCredential.cs/ Azure.Identity central version left as-is.Validation
restore.cmd: clean (0 warnings, 0 errors).#elseMiniDump.Createpath still compiles.Residual risk & rollback
VersionOverride, reverting restores the prior central graph for all other projects with no cross-project cleanup needed.