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

Restart in Rider Aspire Plugin is unstable #141

Open
tjementum opened this issue May 5, 2024 · 10 comments
Open

Restart in Rider Aspire Plugin is unstable #141

tjementum opened this issue May 5, 2024 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@tjementum
Copy link

When using the Aspire Rider Plugin (v6.0.1 and all earlier versions), the "Restart" button is unstable.

Most of the time, it fails to properly restart services and the Aspire Dashboard hangs, and the services do not start (see video 1). Also, after Aspire Preview 5 with the introduction of the login token, the restart fails to send the login token in the URL (see video 2) when restarting (works fine the first time).

In practice, my team and I have just gotten used to clicking stop, waiting a few seconds before starting again. I'm not sure, but it might be that if one starts things before everything is properly shut down, it fails, but I've not been able to find a conclusive pattern.

CleanShot 2024-05-05 at 19 20 16

CleanShot 2024-05-05 at 19 14 00

@rafaelldi rafaelldi self-assigned this May 6, 2024
@rafaelldi rafaelldi added the bug Something isn't working label May 6, 2024
@rafaelldi
Copy link
Collaborator

Thanks for the report, I'll check it out. Out of curiosity, in what cases do you need to restart the Aspire host?

@tjementum
Copy link
Author

Thanks for the report, I'll check it out. Out of curiosity, in what cases do you need to restart the Aspire host?

Every time I change something in my code, literally many times per day. OK... sometimes I stop, then fix, then start. But since there is no support for dotnet watch run in Aspire (AFAIK), I guess this is what all developers will do all day.

@rafaelldi
Copy link
Collaborator

I tried to reproduce your problem, but everything works fine on my side. But I added a hot reload and also these actions to reboot certain projects. So I think this should help in your case.

image

@tjementum
Copy link
Author

My colleague has the same problem. So I don't think it's something on my machine. Maybe it's just a more complex solution.

Maybe try to clone https://github.com/platformplatform/PlatformPlatform and then open the PlatformPlatform.sln in the /application folder.

I will be happy to help testing your fix.

@tjementum
Copy link
Author

Hi @rafaelldi,

I’ve tried the new version 0.7.1 of the plugin, and the restart in the main toolbar still has the same problem, and this is what people will use by default when restarting.

I did find the “restart” in the Dashboard. It’s really awesome that you can restart a single service… something that the Aspire team has not found a way to solve (should be part of the Aspire Dashboard).

I do have some feedback on this new feature:

  • It should be possible to restart all types of Aspire services. It looks like you can only restart .NET projects. Especially, I very often need to restart my frontend React SPA (added to AppHost using builder.AddNpmApp()).

CleanShot 2024-05-15 at 10 10 59

  • It’s very hidden. I do not use this dashboard and it takes too long to find if I just have to restart something. It would be great if this were integrated into the main toolbar.

@rafaelldi
Copy link
Collaborator

Hi! Thank you for the feedback. I'll check the main restart button (maybe it's a linux/mac specific issue?).

Unfortunately, I can't restart all resources. In general, Aspire doesn't support restarting resources. I made a hack inside the plugin to restart projects. But other types of resources Aspire handles on its own, not through the IDE, so I can't do the same. If Aspire adds some API to restart a resource, I will definitely support it.
The run-windget on the main toolbar isn't very customizable, so I don't think I can do much here either. This Services tool window is the preferred way to manage multiple projects (such as Docker or k8s) used in the Intellij platform.

About your restart problem, could you please collect logs and attach them? Here I have an instruction how to do that.

@rafaelldi
Copy link
Collaborator

This problem seems to exist only on macOS. But after updating to dotnet SDK 8.0.3, dotnet aspire to 8.0.1 and a new version of the plugin (not yet released), the problem is no longer reproduced on my machine with your solution. I think something was in the Aspire itself. Please check this out.

@tjementum
Copy link
Author

Hi @rafaelldi,

Just some feedback on this issue. It’s running much more stable now in version 1.2, but it still fails to restart "sometimes". It’s a bit hard to reliably reproduce things, as it’s only 1 out of 4 times when it fails.

But one thing I did notice for sure is that the SQL Server is not stopped properly before the restart. So, I get this error:

/opt/mssql/bin/sqlservr: Another instance of the application is already running.

This is my AppHost setup.

CleanShot 2024-06-12 at 14 14 12

@rafaelldi
Copy link
Collaborator

Perhaps Aspire doesn't clean up resources properly after stopping. The plugin doesn't work with any containers, only with .NET projects; containers are entirely the responsibility of Aspire itself.

@Kralizek
Copy link

Kralizek commented Jul 9, 2024

I just wanted to add that Aspire does support dotnet watch run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants