alamb commented on code in PR #25763:
URL: https://github.com/apache/datafusion/pull/25763#discussion_r4366834660


##########
datafusion/common-runtime/src/common.rs:
##########
@@ -46,7 +55,36 @@ impl<R: 'static> SpawnedTask<R> {
         // Ok to use spawn here as SpawnedTask handles aborting/cancelling the 
task on Drop
         #[expect(clippy::disallowed_methods)]
         let inner = tokio::task::spawn(trace_future(task));
-        Self { inner }
+        Self {
+            inner,
+            reclaim: None,
+        }
+    }
+
+    /// Like [`Self::spawn`], but dropping the handle also drops the task's
+    /// future right away, on the dropping thread, so everything the task owns
+    /// is released by the time `drop` returns. A task that a worker is polling
+    /// at that moment is aborted as usual, and its future is dropped when that
+    /// poll returns.
+    ///
+    /// The future's destructor then runs inside the task's runtime but outside

Review Comment:
   I don't understand this comemnt
   
   What does a "task that depends on what task they run in" mean?



##########
datafusion/common-runtime/src/common.rs:
##########
@@ -46,7 +55,36 @@ impl<R: 'static> SpawnedTask<R> {
         // Ok to use spawn here as SpawnedTask handles aborting/cancelling the 
task on Drop
         #[expect(clippy::disallowed_methods)]
         let inner = tokio::task::spawn(trace_future(task));
-        Self { inner }
+        Self {
+            inner,
+            reclaim: None,
+        }
+    }
+
+    /// Like [`Self::spawn`], but dropping the handle also drops the task's

Review Comment:
   I think I am missing something here -- why do we need a whole separate 
parallel API (spawn_reclaimable rather than just spawn)? 
   
   Why not just make this the default behavior of spawn?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to