gitmodimo commented on code in PR #47129:
URL: https://github.com/apache/arrow/pull/47129#discussion_r2242091636


##########
cpp/src/arrow/dataset/dataset_writer.cc:
##########
@@ -681,13 +683,13 @@ class DatasetWriter::DatasetWriterImpl {
       }
       backpressure =
           
writer_state_->rows_in_flight_throttle.Acquire(next_chunk->num_rows());
-      if (!backpressure.is_finished()) {
+      if (backpressure) {

Review Comment:
   No we cannot. In fact we have to always treat it as if pending. 
   If Acquire returns nullopt then there is no backpressure and we continue 
with write.
   If Acquire returns future we need to reAcquire - because current_value_  was 
not increased.
   In summary optional state is the indicator of backpressure: 
   nullopt - no bacpressure,
   future - backpressure -> create continuation to reAcquire
   



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