How to start and stop an Orleans cluster

95 Views Asked by At

I'm running an Orleans cluster locally. I've plugged in Orleans to my .NET Core Web API, as per the standard recommendations here.

Everything runs just fine, but when I'm developing and repeatedly start my web api in the debugger (Rider IDE) and then stop, every other time I get an error during startup that says: Denying connection to known-dead silo...

Looking through the documentation, the extension method UseConsoleAsync is recommended for shutdown. But when I run it it throws a NotSupportedException, referencing me to use the 'regular' appBuilder.Build() instead. I've also tried UseConsoleLifetime(), but no luck.

So to my question: I can always run a hosted service that simply starts and stops my cluster, but how do I do that? I mean, how can I defer starting and stopping the cluster to my hosted service? What methods do I need to invoke? As it is now it seems like the cluster is auto-starting when I run the Web API.

I'm looking for explicitly controlling startup/shutdown.

0

There are 0 best solutions below