Cancellation management in InitializeApplicationAsync#9850
Merged
Conversation
- Added cancellation token support in ProjectHotReloadSessionManager to handle process exit scenarios gracefully. - Introduced DebugTrace method for logging session activities in debug mode. - Updated DeltaApplier to use TaskCompletionSource for better cancellation management during capability updates. - Modified output window logging to include cancellation token in ProjectHotReloadSession.
… to handle client responsiveness
…tion token handling
davkean
reviewed
Nov 13, 2025
davkean
reviewed
Nov 13, 2025
davkean
reviewed
Nov 13, 2025
davkean
reviewed
Nov 13, 2025
davkean
reviewed
Nov 13, 2025
davkean
reviewed
Nov 13, 2025
davkean
reviewed
Nov 13, 2025
…ve client responsiveness
…ng and responsiveness
…proved session management
…in session management
Member
Author
|
@copilot review pr |
Contributor
|
@LittleLittleCloud I've opened a new pull request, #9851, to work on those changes. Once the pull request is ready, I'll request review from you. |
davkean
reviewed
Nov 14, 2025
davkean
approved these changes
Nov 14, 2025
…session management
…ing and ensure graceful exit
drewnoakes
approved these changes
Nov 14, 2025
…tem/VS/HotReload/ProjectHotReloadSessionManager.cs Co-authored-by: Drew Noakes <git@drewnoakes.com>
…izeApplicationAsync
Member
Author
|
/backport to dev18.0.x |
|
Started backporting to |
|
@LittleLittleCloud backporting to git am output$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Enhance Hot Reload session management and improve cancellation handling
Using index info to reconstruct a base tree...
M src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/HotReload/ProjectHotReloadSessionManager.cs
M src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/HotReload/ProjectHotReloadSession.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/HotReload/ProjectHotReloadSessionManager.cs
Auto-merging src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/HotReload/ProjectHotReloadSession.cs
Applying: Implement cancellation token workaround in InitializeApplicationAsync to handle client responsiveness
Applying: Add comment to clarify workaround for DefaultHotreloadClient cancellation token handling
Applying: Refactor cancellation handling in InitializeApplicationAsync to improve client responsiveness
Applying: Refactor Hot Reload session management to improve cancellation handling and responsiveness
error: sha1 information is lacking or useless (src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/HotReload/ProjectHotReloadSessionManager.cs).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0005 Refactor Hot Reload session management to improve cancellation handling and responsiveness
Error: The process '/usr/bin/git' failed with exit code 128 |
LittleLittleCloud
added a commit
that referenced
this pull request
Nov 16, 2025
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.
InitializeApplicationAsyncwill wait named pipe connection from application forever inGetUpdateCapabilitiesAsync. This assumes that application always replies their capabilities back to hotreload client, which is not true in some corner cases, such asThis PR mitigate the forever waiting process by introducing a task cancellation source to
InitializeApplicationAsyncand return when eitherGetUpdateCapabilitiesAsyncor cancellation token get cancelled.