westonpace commented on a change in pull request #10401:
URL: https://github.com/apache/arrow/pull/10401#discussion_r648832182



##########
File path: cpp/src/arrow/util/future_test.cc
##########
@@ -106,12 +107,18 @@ template <typename T>
 class SimpleExecutor {
  public:
   explicit SimpleExecutor(int nfutures)
-      : pool_(ThreadPool::Make(/*threads=*/4).ValueOrDie()) {
+      : pool_(SimpleThreadPool::Make(/*threads=*/4).ValueOrDie()) {
     for (int i = 0; i < nfutures; ++i) {
       futures_.push_back(Future<T>::Make());
     }
   }
 
+  // Need to explicilty call the pool shutdown.  The worker threads have a 
shared_ptr
+  // to the pool so they will keep it alive after this class is destructed.  
However, the

Review comment:
       Actually, it was the former, and that was the ASAN error.  If the worker 
threads have a strong reference to the thread pool then the thread pool is 
never destroyed unless it is shutdown (which doesn't work for the eternal 
pools).  I've fixed it now as worker threads only have a reference to the 
thread pool's state and not the thread pool (as it was originally).




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

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


Reply via email to