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.
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.
I'd say we should also look at renaming the methods to
The "OrleansSlio" part of the names is superfluous IMO. Not sure how it snuck in.
@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.
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.
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?
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.
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?
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.
We do need a doc page to explain all this.
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).
I think this behavior should be overridable. @TrexinanF14 can you prepare a PR?
Sure.
Most helpful comment
We do need a doc page to explain all this.