Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aspire 9 preview 1 processes take long time to shut down #6437

Closed
1 task done
jack775544 opened this issue Oct 23, 2024 · 17 comments
Closed
1 task done

Aspire 9 preview 1 processes take long time to shut down #6437

jack775544 opened this issue Oct 23, 2024 · 17 comments
Labels
untriaged New issue has not been triaged

Comments

@jack775544
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I have an Aspire project that contains a mix of container resources, executable resources (all running node) and project resources. After testing Aspire 9 preview 1, I have noticed that on shutting down the app host, the non container resources take a considerable time to shut down or in some cases, do not shut down at all. This also includes the dashboard process not shutting down as well.

In my project, I have no persistent resources.

Expected Behavior

After shutting down the app host, all services should be shut down.

Steps To Reproduce

  • Start AppHost project
  • Close AppHost project
  • Run Get-Process *dashboard* (or the name of any other process being run by Aspire
  • Note that there are still listed.
  • Wait a few minutes and run Get-Process again, some of the resources will be stopped but some will remain.

Exceptions (if any)

No response

.NET Version info

.NET SDK:
 Version:           8.0.403
 Commit:            c64aa40a71
 Workload version:  8.0.400-manifests.c15ea148
 MSBuild version:   17.11.9+a69bbaaf5

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22631
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\8.0.403\

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
 [aspire]
   Installation Source: VS 17.11.35327.3
   Manifest Version:    8.2.0/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.2.0\WorkloadManifest.json
   Install Type:        FileBased


Host:
  Version:      8.0.10
  Architecture: x64
  Commit:       81cabf2857

.NET SDKs installed:
  6.0.427 [C:\Program Files\dotnet\sdk]
  8.0.206 [C:\Program Files\dotnet\sdk]
  8.0.403 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.35 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.35 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.35 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Anything else?

I have seen this behaviour from running the AppHost from the command line and from Rider.

@davidfowl
Copy link
Member

See #6221 (comment), this should be fixed in later builds.

@jack775544
Copy link
Author

See #6221 (comment), this should be fixed in later builds.

Sounds good. The only thing different from that ticket is that I am also getting this for project resources and the dashboard as well.

@davidfowl
Copy link
Member

Sounds good. The only thing different from that ticket is that I am also getting this for project resources and the dashboard as well.

Can you reproduce this with a new started project?

@jack775544
Copy link
Author

I just gave it a go on a new project by doing dotnet new aspire-starter and upgrading it to 9.0.0-rc.1.24511.1.

Shutting down the project worked fine there.

I then added a node project and after that it caused the project resources to not stop correctly. My test repo is here, though it sounds like this problem is pretty well understood at this point https://github.com/jack775544/AspireStopBug

@davidfowl
Copy link
Member

Seems like the same problem. If you want to try out a newer build, you can try:

dotnet new install Aspire.ProjectTemplates::9.0.0-rc2* --force

You'll get new templates with the fix.

@davidfowl
Copy link
Member

You should be able to switch back to the RC1 templates easily as well

@joperezr joperezr added untriaged New issue has not been triaged needs-author-action An issue or pull request that requires more info or actions from the author. labels Oct 23, 2024
@joperezr
Copy link
Member

@jack775544 Can you confirm that using newer templates fixed the issue for you?

@jsheetzmt
Copy link

jsheetzmt commented Oct 30, 2024

Any tricks to use RC2? Trying to install the templates and getting an error back

Image

@davidfowl
Copy link
Member

@jsheetzmt
Copy link

I have this for my nuget.config. Also tried https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json (updated dotnet8 to dotnet9)

<?xml version="1.0" encoding="utf-8"?>
<configuration>
	<packageSources>
		<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
		<add key="aspire" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
	</packageSources>
	<packageSourceMapping>
		<packageSource key="nuget.org">
			<package pattern="*" />
		</packageSource>
		<packageSource key="aspire">
			<package pattern="Aspire.*" />
			<package pattern="Microsoft.Extensions.ServiceDiscovery*" />
		</packageSource>
	</packageSourceMapping>
</configuration>

@jsheetzmt
Copy link

jsheetzmt commented Oct 30, 2024

dotnet new install Aspire.ProjectTemplates::9.0.0-rc2* --force command isn't working but with the feeds setup, I can at least upgrade the packages using Manage Nuget Packages

However, still have this error when attempting to build:
Error (active) MSB4236 The SDK 'Aspire.AppHost.Sdk/9.0.0-rc.2.24519.2' specified could not be found.

@jack775544
Copy link
Author

@jack775544 Can you confirm that using newer templates fixed the issue for you?

I am out of town without a computer right now but I will be able to test it out next week.

@dotnet-policy-service dotnet-policy-service bot removed the needs-author-action An issue or pull request that requires more info or actions from the author. label Oct 30, 2024
@jack775544
Copy link
Author

I have attempted to confirm this but I can't upgrade to the rc2 version as described, similar to the others in the thread. To rule out any local config I tried downloading the templates into a dotnet sdk docker container and got the same error.

❯ docker run -it --rm -v .:/app mcr.microsoft.com/dotnet/sdk:8.0 bin/bash
root@d157f277f8f3:/# dotnet nuget add source --name dotnet9 https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json
Package source with Name: dotnet9 added successfully.
root@d157f277f8f3:/# dotnet new install Aspire.ProjectTemplates::9.0.0-rc2* --force
The following template packages will be installed:
   Aspire.ProjectTemplates::9.0.0-rc2*

Aspire.ProjectTemplates::9.0.0-rc2* could not be installed, the package does not exist.

For details on the exit code, refer to https://aka.ms/templating-exit-codes#103
root@d157f277f8f3:/#

@davidfowl
Copy link
Member

Try out 9.1.0-*

@davidfowl
Copy link
Member

The instructions have been updated https://github.com/dotnet/aspire/blob/main/docs/using-latest-daily.md

@jack775544
Copy link
Author

Thanks for the help. I just tried it using version 9.1.0-preview.1.24553.1 and my services are now shutting down correctly.

@joperezr
Copy link
Member

joperezr commented Nov 6, 2024

Thanks for confirming. Closing.

@joperezr joperezr closed this as completed Nov 6, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Dec 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
untriaged New issue has not been triaged
Projects
None yet
Development

No branches or pull requests

4 participants