orleans icon indicating copy to clipboard operation
orleans copied to clipboard

Clarify different shutdown methods

Open lucasgodshalk opened this issue 10 years ago • 12 comments

On the SiloHost class, there are 4 methods that seem to correspond with shutting down the silo. I've listed them below along with the documentation about them.

  • ShutdownOrleansSilo - Gracefully shutdown this silo.
  • StopOrleansSilo - Stop this silo.
  • UnInitializeOrleansSilo - Uninitialize this silo.
  • WaitForOrleansSiloShutdown - Wait for this silo to shutdown.

Could someone explain what each of these methods do in more detail? I'd like to eventually create a pull request that would add more fleshed out descriptions to the documentation, just so it is more clear what the consequences of calling each of these methods is.

lucasgodshalk avatar Sep 07 '16 21:09 lucasgodshalk

I'd say we should also look at renaming the methods to

  • Shutdown
  • Stop
  • UnInitialize
  • WaitForShutdown

The "OrleansSlio" part of the names is superfluous IMO. Not sure how it snuck in.

sergeybykov avatar Sep 07 '16 23:09 sergeybykov

@sergeybykov I believe we should rename StopOrleansSilo to Abort to indicate that it's a non-graceful termination.

Similarly, we should consider renaming the corresponding methods on Silo.

ReubenBond avatar Sep 08 '16 00:09 ReubenBond

I believe we should rename StopOrleansSilo to Abort to indicate that it's a non-graceful termination.

Maybe Kill?

Similarly, we should consider renaming the corresponding methods on Silo.

Yep.

sergeybykov avatar Sep 08 '16 00:09 sergeybykov

So just to clarify, StopOrleansSilo means that:

  1. All messages that are currently being process get dropped without response (and the caller would eventually time out?).
  2. The OnDeactivateAsync() grain method will not get called.
  3. The silo will not update the silo table to say that it is dead.

Are any of these incorrect?

lucasgodshalk avatar Sep 08 '16 00:09 lucasgodshalk

  1. Correct. The caller may get an error sooner than the timeout due to sockets getting closed.
  2. Correct.
  3. It will try to update the membership table.

sergeybykov avatar Sep 08 '16 00:09 sergeybykov

So a few more questions: I assume the ShutdownOrleansSilo method will 1) process all messages and 2) call Deactivate on grains, right? What's the difference between ShutdownOrleansSilo and WaitForShutdown? What does UnInitializeOrleansSilo do?

lucasgodshalk avatar Sep 08 '16 16:09 lucasgodshalk

I assume the ShutdownOrleansSilo method will 1) process all messages and 2) call Deactivate on grains, right?

Correct.

What's the difference between ShutdownOrleansSilo and WaitForShutdown?

ShutdownOrleansSilo blocks the caller until it's done anyway. The only case for WaitForShutdown I think is to block some external code for while the silo is running, e.g. in a hosting process.

What does UnInitializeOrleansSilo do?

It cleans up all statics, so that another (or the same) silo can be initialized in the same app domain.

sergeybykov avatar Sep 08 '16 17:09 sergeybykov

We do need a doc page to explain all this.

sergeybykov avatar Sep 08 '16 17:09 sergeybykov

While we're on the topic of shutting down, could we change the orleans silo to not listen for the Console.CancelKeyPress event? It currently causes the silo to kill itself, but I'd like to define my own behavior for that event (doing graceful shutdown, etc).

lucasgodshalk avatar Sep 09 '16 15:09 lucasgodshalk

I think this behavior should be overridable. @TrexinanF14 can you prepare a PR?

sergeybykov avatar Sep 09 '16 15:09 sergeybykov

Sure.

lucasgodshalk avatar Sep 09 '16 21:09 lucasgodshalk

This issue has been marked stale for the past 30 and is being closed due to lack of activity.

ghost avatar Mar 05 '22 23:03 ghost