jerry-024 commented on code in PR #873:
URL: https://github.com/apache/paimon-rust/pull/873#discussion_r4055636205


##########
crates/integrations/datafusion/src/runtime.rs:
##########
@@ -103,14 +103,18 @@ where
     F: Future + Send + 'static,
     F::Output: Send + 'static,
 {
-    if Handle::try_current().is_ok() {
-        let handle = global_runtime().handle().clone();
-        std::thread::spawn(move || handle.block_on(future))
+    if let Ok(handle) = Handle::try_current() {
+        if handle.runtime_flavor() == RuntimeFlavor::MultiThread {

Review Comment:
   <!-- dlf-review -->
   **[Major] Checking only `RuntimeFlavor::MultiThread` can still panic here.**
   
   `LocalSet::run_until` may run on a multi-thread runtime while explicitly 
disabling `block_in_place`. `Handle::try_current()` still returns that 
multi-thread handle, so this branch panics instead of taking the previous 
fallback path.
   
   Please preserve a non-panicking fallback when in-place blocking is 
disallowed and add a `multi_thread` + `LocalSet::run_until` regression test.



-- 
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