summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@vespa.ai>2024-04-09 15:55:58 +0000
committerTor Brede Vekterli <vekterli@vespa.ai>2024-04-09 15:55:58 +0000
commit32df7bf1195fd3c90a77efb1aa7311e4655c1737 (patch)
treee7713c1cd34b09dd275136a37c61c13f0cfc54dd
parent9c99d7c58942bd3c035cfa3e0be4bffa515646e1 (diff)
Low-level message fetch routine must not implicitly unlock mutex
Implicitly unlocking messes up higher level assumptions about when locks are held and thus cannot be safely done. Lock will be unlocked immediately after anyway, so this does not seem like a useful optimization.
-rw-r--r--storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp
index 6365eb1ab30..7589fb3cdb3 100644
--- a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp
+++ b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp
@@ -1058,6 +1058,7 @@ FileStorHandlerImpl::Stripe::fill_feed_op_batch(monitor_guard& guard, LockedMess
uint32_t max_batch_size, vespalib::steady_time now)
{
assert(batch.size() == 1);
+ assert(guard.owns_lock());
BucketIdx& idx = bmi::get<2>(*_queue);
auto bucket_msgs = idx.equal_range(batch.lock->getBucket());
// Process in FIFO order (_not_ priority order) until we hit the end, a non-batchable operation
@@ -1136,7 +1137,6 @@ FileStorHandlerImpl::Stripe::getMessage(monitor_guard & guard, PriorityIdx & idx
auto locker = std::make_unique<BucketLock>(guard, *this, bucket, msg->getPriority(),
msg->getType().getId(), msg->getMsgId(),
msg->lockingRequirements());
- guard.unlock();
return {std::move(locker), std::move(msg), std::move(throttle_token)};
} else {
std::shared_ptr<api::StorageReply> msgReply(makeQueueTimeoutReply(*msg));