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


##########
datafusion/physical-plan/src/repartition/mod.rs:
##########
@@ -1812,12 +1812,15 @@ impl ExecutionPlan for RepartitionExec {
                     .remove(&partition)
                     .expect("partition not used yet");
 
-                (
-                    rx,
-                    reservation,
-                    spill_readers,
-                    Arc::clone(&state.abort_helper),
-                )
+                // The last output partition takes the handle. Otherwise the 
plan node
+                // keeps the input tasks alive after every output stream drops.
+                let abort_helper = if state.channels.is_empty() {
+                    std::mem::take(&mut state.abort_helper)

Review Comment:
   I think this makes sense to me (basically all partitions get a copy of the 
handle but once the repartitionexec has started up completely the handles are 
removed from the ExecutionPlan node)
   
   Could I request that you update the comment of the `abort_helper` field (aka 
that it is reset once the repartition has started all its streams)?
   
   
   



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