Skip to content
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

Closed
bkchr opened this issue Aug 28, 2021 · 2 comments
Closed

Do not drop Tokio runtime is async context #9643

bkchr opened this issue Aug 28, 2021 · 2 comments
Labels
I3-bug The node fails to follow expected behavior.

Comments

@bkchr
Copy link
Member

bkchr commented Aug 28, 2021

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.

@bkchr bkchr added the I3-bug The node fails to follow expected behavior. label Aug 28, 2021
@nazar-pc
Copy link
Contributor

nazar-pc commented Dec 5, 2021

Was this resolved by #9737?

@bkchr
Copy link
Member Author

bkchr commented Dec 5, 2021

Yes ;) Ty for reminding me.

@bkchr bkchr closed this as completed Dec 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I3-bug The node fails to follow expected behavior.
Projects
None yet
Development

No branches or pull requests

2 participants