Skip to content

Commit aaeefd8

Browse files
author
Rafał Hibner
committed
Fix max_open_files throttle threshold
1 parent 4ff0cb5 commit aaeefd8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cpp/src/arrow/dataset/dataset_writer.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Throttle {
5858
return Future<>::MakeFinished();
5959
}
6060
std::lock_guard<std::mutex> lg(mutex_);
61-
if (current_value_ > max_value_) {
61+
if (current_value_ >= max_value_) {
6262
in_waiting_ = values;
6363
backpressure_ = Future<>::Make();
6464
} else {
@@ -75,7 +75,7 @@ class Throttle {
7575
{
7676
std::lock_guard<std::mutex> lg(mutex_);
7777
current_value_ -= values;
78-
if (in_waiting_ > 0 && current_value_ <= max_value_) {
78+
if (in_waiting_ > 0 && current_value_ < max_value_) {
7979
in_waiting_ = 0;
8080
to_complete = backpressure_;
8181
}

0 commit comments

Comments
 (0)