pitrou commented on code in PR #46711:
URL: https://github.com/apache/arrow/pull/46711#discussion_r2140704195
##########
cpp/src/arrow/dataset/dataset_writer.cc:
##########
@@ -520,11 +543,26 @@ class DatasetWriter::DatasetWriterImpl {
return Status::OK();
})),
write_options_(std::move(write_options)),
- writer_state_(max_rows_queued, write_options_.max_open_files,
- CalculateMaxRowsStaged(max_rows_queued)),
+ writer_state_(std::make_shared<DatasetWriterState>(
+ max_rows_queued, write_options_.max_open_files,
+ CalculateMaxRowsStaged(max_rows_queued))),
pause_callback_(std::move(pause_callback)),
resume_callback_(std::move(resume_callback)) {}
+ ~DatasetWriterImpl() {
+ // In case something went wrong (e.g. an IO error occurred), some tasks
+ // may be left dangling in a ThrottledAsyncTaskScheduler and that may
Review Comment:
Honestly I haven't tried to analyze this very deeply. It might be the
`file_finish_task` actually? In any case, this is necessary to suppress the
memory leaks in error cases.
--
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]