aboutsummaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahooinc.com>2023-04-04 12:10:39 +0000
committerTor Brede Vekterli <vekterli@yahooinc.com>2023-04-04 12:10:39 +0000
commit111b7b462f054abe4bda9fba3867a7e9301fd21e (patch)
treecae709fc5260a499a8913f966ce4e6b1a2e31200 /storage
parent0e4087a7f26dcf324fdc378bf437f29fee9af2b2 (diff)
Use timed waits on persistence queue condition variable
This is a pragmatic workaround for our current optimistic signalling mechanisms seemingly being susceptible to lost wakeups under certain conditions. We should redesign how persistence queue signalling works on a more fundamental level to avoid this scenario altogether, but for now this will at least remove the possibility that a thread may be stalled if the persistence queues are completely quiescent over longer periods of time.
Diffstat (limited to 'storage')
-rw-r--r--storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp
index 92b9e832a23..1d29a8795d5 100644
--- a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp
+++ b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp
@@ -1054,7 +1054,7 @@ FileStorHandlerImpl::Stripe::waitUntilNoLocks() const
{
std::unique_lock guard(*_lock);
while (!_lockedBuckets.empty()) {
- _cond->wait(guard);
+ _cond->wait_for(guard, 100ms);
}
}
@@ -1062,7 +1062,7 @@ void
FileStorHandlerImpl::Stripe::waitInactive(const AbortBucketOperationsCommand& cmd) const {
std::unique_lock guard(*_lock);
while (hasActive(guard, cmd)) {
- _cond->wait(guard);
+ _cond->wait_for(guard, 100ms);
}
}