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



##########
File path: cpp/src/arrow/dataset/scanner_test.cc
##########
@@ -1026,6 +1026,14 @@ class TestBackpressure : public ::testing::Test {
     return sum;
   }
 
+  void Finish(AsyncGenerator<EnumeratedRecordBatch> gen) {
+    for (const auto& controlled_fragment : controlled_fragments_) {
+      controlled_fragment->Finish();
+    }
+    ASSERT_FINISHES_OK(VisitAsyncGenerator(
+        gen, [](EnumeratedRecordBatch batch) { return Status::OK(); }));
+  }
+

Review comment:
       A minimal example of the problem is:
   ```
   TEST(Weston, MemTest) {
     PushGenerator<util::optional<int>> int_prod;
     AsyncGenerator<util::optional<int>> int_gen = int_prod;
     Future<> visit_fut = VisitAsyncGenerator(std::move(int_gen), [] 
(util::optional<int>) {
       return Status::OK();
     });
   }
   ```
   The above will leak.  I have a fix in mind but will address it in a separate 
PR.




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