-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Currently a number of ExecutionPlan operators call tokio::spawn, tokio::spawn_blocking, etc... and will therefore panic if used outside of a tokio runtime. This prevents an incremental migration towards an alternative scheduler (#2199)
Describe the solution you'd like
Operators should use Handle::try_current to determine if running within a tokio context and adjust their behaviour accordingly.
Describe alternatives you've considered
The new scheduler could use Runtime::enter in order to allow the usage of tokio on its worker threads. However, whilst this would work, it would result in work being offloaded from the scheduler's thread pool to the tokio thread pool, which we do not want.