nealrichardson commented on code in PR #13706:
URL: https://github.com/apache/arrow/pull/13706#discussion_r957312673


##########
r/R/arrow-package.R:
##########
@@ -81,6 +81,14 @@
   invisible()
 }
 
+.onUnload <- function(...) {
+  # When running valgrind we need to wait for the thread pools to finish
+  # running background tasks or else spurious memory leaks may be reported.
+  if (on_linux_dev()) {

Review Comment:
   Why only if on_linux_dev?



##########
r/src/threadpool.cpp:
##########
@@ -54,3 +54,17 @@ int GetIOThreadPoolCapacity() { return 
arrow::io::GetIOThreadPoolCapacity(); }
 void SetIOThreadPoolCapacity(int threads) {
   StopIfNotOk(arrow::io::SetIOThreadPoolCapacity(threads));
 }
+
+namespace arrow {
+namespace io {
+namespace internal {
+arrow::internal::ThreadPool* GetIOThreadPool();
+}
+}  // namespace io
+}  // namespace arrow
+
+// [[arrow::export]]
+void WaitForIdleThreadPool() {

Review Comment:
   Do these waits have a timeout? Or could they wait forever?



##########
r/R/table.R:
##########
@@ -331,12 +331,5 @@ as_arrow_table.arrow_dplyr_query <- function(x, ...) {
   # See query-engine.R for ExecPlan/Nodes

Review Comment:
   Can all of this be simplified now to 
`as_arrow_table(as_record_batch_reader(x))` now?



##########
r/R/query-engine.R:
##########
@@ -238,18 +227,13 @@ ExecPlan <- R6Class("ExecPlan",
         slice_size <- node$extras$head %||% node$extras$tail
         if (!is.null(slice_size)) {
           out <- head(out, slice_size)
-          # We already have everything we need for the head, so StopProducing
-          self$Stop()

Review Comment:
   Why don't we want/need this anymore?



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