Skip to content

Conversation

mitchdenny
Copy link
Member

This PR fixes hangs when using aspire run --watch. There was a bug introduced when I split out the build leg from starting the app host. Basically I started attempting to launch the apphost in --no-build mode which is fine -except when you are in watch mode. RunAsync checks for this and throws an exception, unfortunately awaiting the result of RunAsync doesn't occur until after the backchannel has returned.

So the fix involves a few things:

  1. Fix the logic so that when running with --watch we don't try launch the app host in --no-build mode.
  2. Fix the logic in RunAsync where it checks and throws to also call SetException on the backchannel completion source.
  3. Fix the logic so we don't bother prebuilding when in watch mode as it ultimately makes startup slower.

@Copilot Copilot AI review requested due to automatic review settings April 7, 2025 13:38
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Apr 7, 2025
@mitchdenny mitchdenny self-assigned this Apr 7, 2025
@mitchdenny mitchdenny requested a review from davidfowl April 7, 2025 13:38
@mitchdenny mitchdenny added this to the 9.2 milestone Apr 7, 2025
@davidfowl davidfowl removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Apr 7, 2025
@danmoseley danmoseley added the Servicing-approved Approved for servicing release label Apr 7, 2025
@danmoseley
Copy link
Member

/backport to release/9.2

Copy link
Contributor

github-actions bot commented Apr 7, 2025

Started backporting to release/9.2: https://github.com/dotnet/aspire/actions/runs/14314418109

@danmoseley danmoseley removed the Servicing-approved Approved for servicing release label Apr 7, 2025
@davidfowl
Copy link
Member

omg conflicts

@danmoseley
Copy link
Member

@mitchdenny can you resolve here and in 9.2 pls.

@danmoseley danmoseley mentioned this pull request Apr 7, 2025
@mitchdenny mitchdenny merged commit 8489a32 into main Apr 7, 2025
174 checks passed
@mitchdenny mitchdenny deleted the mitchdenny/fix-watch-hangs branch April 7, 2025 21:55
@mitchdenny
Copy link
Member Author

/backport to release/9.2

Copy link
Contributor

github-actions bot commented Apr 7, 2025

Started backporting to release/9.2: https://github.com/dotnet/aspire/actions/runs/14320264831

Copy link
Contributor

github-actions bot commented Apr 7, 2025

@mitchdenny backporting to "release/9.2" failed, the patch most likely resulted in conflicts:

$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Fix --watch hangs.
Applying: Don't prebuild in watch mode.
Applying: Fix up merge.
error: sha1 information is lacking or useless (src/Aspire.Cli/Commands/RunCommand.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 0003 Fix up merge.
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

mitchdenny added a commit that referenced this pull request Apr 7, 2025
* Fix --watch hangs.

* Don't prebuild in watch mode.

* Fix up merge.
danmoseley pushed a commit that referenced this pull request Apr 8, 2025
* Add RPC protocol compat check. (#8577)

* Add RPC protocol compat check.

* Fix merge conflict.

* Fix spelling.

* Update DotNetCliRunner.cs

Co-authored-by: David Fowler <[email protected]>

* Improve error message with version info.

---------

Co-authored-by: David Fowler <[email protected]>

* Fix --watch hangs. (#8585)

* Fix --watch hangs.

* Don't prebuild in watch mode.

* Fix up merge.

* Add watch/no-build conflict fix.

* Fix spelling.

* Spelling.

---------

Co-authored-by: David Fowler <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators May 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants