From 6f2271d971d428aad93bfa9dec3fe291c2d61249 Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Mon, 24 Jan 2022 17:35:59 +0100 Subject: Don't allow pending ops in DynamicOperationThrottler when destroying instance. --- vespalib/src/vespa/vespalib/util/shared_operation_throttler.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vespalib/src/vespa/vespalib/util/shared_operation_throttler.cpp b/vespalib/src/vespa/vespalib/util/shared_operation_throttler.cpp index e91be68a671..dd790bcaa0a 100644 --- a/vespalib/src/vespa/vespalib/util/shared_operation_throttler.cpp +++ b/vespalib/src/vespa/vespalib/util/shared_operation_throttler.cpp @@ -244,7 +244,10 @@ DynamicOperationThrottler::DynamicOperationThrottler(const DynamicThrottleParams { } -DynamicOperationThrottler::~DynamicOperationThrottler() = default; +DynamicOperationThrottler::~DynamicOperationThrottler() +{ + assert(_pending_ops == 0u); +} bool DynamicOperationThrottler::has_spare_capacity_in_active_window() noexcept -- cgit v1.2.3