aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--storage/src/vespa/storage/persistence/shared_operation_throttler.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/storage/src/vespa/storage/persistence/shared_operation_throttler.cpp b/storage/src/vespa/storage/persistence/shared_operation_throttler.cpp
index 002c4a94387..4c0fadc74b1 100644
--- a/storage/src/vespa/storage/persistence/shared_operation_throttler.cpp
+++ b/storage/src/vespa/storage/persistence/shared_operation_throttler.cpp
@@ -149,7 +149,8 @@ DynamicOperationThrottler::release_one() noexcept
{
std::unique_lock lock(_mutex);
subtract_one_from_active_window_size();
- if (_waiting_threads > 0) {
+ // Only wake up a waiting thread if doing so would possibly result in success.
+ if ((_waiting_threads > 0) && has_spare_capacity_in_active_window()) {
lock.unlock();
_cond.notify_one();
}