icexelloss commented on code in PR #35953:
URL: https://github.com/apache/arrow/pull/35953#discussion_r1228662852


##########
cpp/src/arrow/util/thread_pool.h:
##########
@@ -301,8 +301,10 @@ class ARROW_EXPORT SerialExecutor : public Executor {
   /// approach is to use a stop token to cause the generator to exhaust early.
   template <typename T>
   static Iterator<T> IterateGenerator(
-      internal::FnOnce<Result<std::function<Future<T>()>>(Executor*)> 
initial_task) {
+      internal::FnOnce<Result<std::function<Future<T>()>>(Executor*)> 
initial_task,
+      internal::SerialExecutor** serial_executor_out = NULLPTR) {

Review Comment:
   If I read the code correctly - it seems like BatchConverter destructor is 
called when the PlanReader gets destructed (since BatchConverter is a member of 
the batch_iterator which is a member of the PlanReader) (related code: 
https://github.com/apache/arrow/blob/e53db939bfad2f20e332172ab4f453add1dc680d/cpp/src/arrow/acero/exec_plan.cc#L1028)
   
   This means that the destructor doesn't gets called during `Close()` / 
`iterator_.reset()`, which would explain why it didn't work before. @westonpace 
Does that sound correct?



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