westonpace commented on code in PR #13912:
URL: https://github.com/apache/arrow/pull/13912#discussion_r950427174


##########
cpp/src/arrow/dataset/file_base.cc:
##########
@@ -488,13 +504,15 @@ class TeeNode : public compute::MapNode {
   const char* kind_name() const override { return "TeeNode"; }
 
   void Finish(Status finish_st) override {
-    dataset_writer_->Finish().AddCallback([this, finish_st](const Status& 
dw_status) {
-      // Need to wait for the task group to complete regardless of dw_status
-      task_group_.End().AddCallback(
-          [this, dw_status, finish_st](const Status& tg_status) {
-            finished_.MarkFinished(dw_status & finish_st & tg_status);
-          });
-    });
+    if (!finish_st.ok()) {
+      MapNode::Finish(std::move(finish_st));
+    }
+    Status writer_finish_st = dataset_writer_->Finish();
+    if (!writer_finish_st.ok()) {
+      MapNode::Finish(std::move(writer_finish_st));
+    }
+    serial_scheduler_->End();
+    MapNode::Finish(Status::OK());

Review Comment:
   Oops, good catch.  I should return after that first call to 
`MapNode::Finish`.



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