This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Do not drop Tokio runtime is async context #9643
Labels
I3-bug
The node fails to follow expected behavior.
Tokio doesn't like to be dropped in a async context. The problem is that the rpc is spawning its own Tokio instance that gets dropped as part of the task manager when an error happens at initialization. On normal operation mode we currently hack around this problem by dropping it in a separate thread...
A possible solution to this problem is that we make the task manager aware of the Tokio and not being generic over the executor (currently everybody uses Tokio anyway). Then we can pass the runtime handle to the rpc initialization to prevent that its starts its own Tokio instance (we need to verify that there is indeed no instance started). After implementing this we need to check on a rpc node that the performance didn't degrade or otherwise we need to provide a way to increase the number of threads used by Tokio.
The text was updated successfully, but these errors were encountered: