Open
Description
If we spawn a task (e.g. with spawn_ref
), and that task spawns sub-tasks, and we drop/abort the parent task, the child sub-tasks aren't aborted. This can lead to unexpected behavior.
For example, a p2p::authenticated::Network
spawns sub-tasks for the tracker, router, etc.. Aborting the network handle doesn't stop these tasks, meaning that for most intents and purposes the network is still running.
We should have a mechanism in the runtime to enable aborting of sub-tasks when the parent task is aborted.