Shutdown sequence
WhenStop(ctx) is called, the system:
- Stops background services (eviction, passivation, scheduler)
- Runs coordinated shutdown hooks (if registered)
- Stops datacenter services (if enabled)
- Snapshots cluster state (if clustered)
- Shuts down user actors depth-first (children before parents)
- Deactivates all grains
- Shuts down system actors
- Leaves cluster and stops remoting
shutdownTimeout (default: 3 minutes) bounds the total time.
Shutdown hooks
Register hooks viaWithCoordinatedShutdown(hooks...) when creating the actor system. Hooks run during shutdown, before actors are stopped.
The ShutdownHook interface
Recovery strategies
Configuring recovery
Recovery() method.
Shutdown timeout
UseWithShutdownTimeout(duration) when creating the actor system to bound the total shutdown time. The default is 3 minutes.