yjshen commented on a change in pull request #811:
URL: https://github.com/apache/arrow-datafusion/pull/811#discussion_r692659385



##########
File path: datafusion/Cargo.toml
##########
@@ -56,9 +56,9 @@ paste = "^1.0"
 num_cpus = "1.13.0"
 chrono = "0.4"
 async-trait = "0.1.41"
-futures = "0.3"
+futures = { version = "0.3", features = ["executor"] }

Review comment:
       While using `tokio::runtime::Handle::block_on`, I'm facing with:
   > ’Cannot start a runtime from within a runtime. This happens because a 
function (like `block_on`) attempted to block the current thread while the 
thread is being used to drive asynchronous tasks.
   
   Since `block_on` is `try_enter`ing an already entered runtime, therefore I 
changed to `future::executor`'s to avoid panic in the first place. But as I 
noted before, `future::executor::block_on` is also flawed here:
   
   > However, this approach is flawed for block_on may block the only thread in 
tokio, and the future inside won't get a chance to run, therefore hanging 
forever if the tokio runtime is not a multi-threaded one. (I temporarily change 
the related test to use #[tokio::test(flavor = "multi_thread", worker_threads = 
2)] to avoid hanging). 
   
   Do you have any suggestions on this?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to