Implement auto-relaunch on process crash#53314
Open
tmat wants to merge 2 commits intodotnet:release/10.0.3xxfrom
Open
Implement auto-relaunch on process crash#53314tmat wants to merge 2 commits intodotnet:release/10.0.3xxfrom
tmat wants to merge 2 commits intodotnet:release/10.0.3xxfrom
Conversation
Member
Author
|
@DustinCampbell ptal |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds auto-relaunch behavior to dotnet watch Hot Reload so that peripheral projects that crash (non-zero exit) are relaunched after a subsequent relevant file change, and includes a regression test for the scenario.
Changes:
- Track crashed peripheral project instances and queue relaunch operations to be executed on subsequent file changes.
- Integrate relaunch execution into the Hot Reload update/apply loop.
- Add a new test validating relaunch-on-crash behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/dotnet-watch.Tests/HotReload/RuntimeProcessLauncherTests.cs | Adds a new test that crashes a service process and asserts it is relaunched after a file change. |
| src/Dotnet.Watch/dotnet-watch/Properties/launchSettings.json | Modifies the debug working directory setting for the dotnet-watch launch profile. |
| src/Dotnet.Watch/Watch/Utilities/ImmutableDictionaryExtensions.cs | Adds helper extensions for ImmutableDictionary<TKey, ImmutableArray<TValue>> to simplify add/remove and iteration. |
| src/Dotnet.Watch/Watch/UI/IReporter.cs | Introduces new message descriptors for relaunch lifecycle and crash notification. |
| src/Dotnet.Watch/Watch/Process/RunningProject.cs | Adds a relaunch-flavored restart operation wrapper with dedicated logging. |
| src/Dotnet.Watch/Watch/HotReload/HotReloadDotNetWatcher.cs | Wires relaunch behavior into the main watch loop and adjusts file-change waiting behavior for unhandled exceptions. |
| src/Dotnet.Watch/Watch/HotReload/CompilationHandler.cs | Implements relaunch operation tracking, scheduling, and triggering based on changed files/project graph. |
test/dotnet-watch.Tests/HotReload/RuntimeProcessLauncherTests.cs
Outdated
Show resolved
Hide resolved
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.
When a process crashes (i.e. terminates with non-zero exit code) any change to the source files of the project or any of its dependencies will trigger relaunching of the project. If a project is launched multiple times and multiple processes crash each crashed one is relaunched after the file change.