substrate
substrate copied to clipboard
Provide an API for service-spawned tasks to participate in shutdown process
re: https://github.com/paritytech/polkadot-sdk/issues/985
It would be nice to give a task the opportunity to observe a request for shutdown and forward that to various sub-tasks to give them an opportunity to wrap up their current work and shut down gracefully.
In fact, in Polkadot it's likely that validator node shutdowns before we have this feature will lead to small delays in finality, because the node will have announced it is going to do some work and then never does it, leading to other nodes getting suspicious and waiting for backup.