summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorGeir Storli <geirst@oath.com>2018-11-16 14:57:26 +0000
committerGeir Storli <geirst@oath.com>2018-11-16 14:57:26 +0000
commit106e612a3f720e65325a8b66348c2248013c92a5 (patch)
tree0167e278b4d7221b2efb44b91a6cbc15325c6cff /searchcore
parentcae7456c12e1bd3d22c0900772f9e53d1c14b2d5 (diff)
Ensure attribute status is updated before giving exclusive read access.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.cpp b/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.cpp
index d1d5b1c9af7..7a31580fb16 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.cpp
@@ -37,8 +37,9 @@ ExclusiveAttributeReadAccessor(const AttributeVector::SP &attribute,
namespace {
void
-attributeWriteBlockingTask(GateSP entranceGate, GateSP exitGate)
+attributeWriteBlockingTask(AttributeVector::SP attribute, GateSP entranceGate, GateSP exitGate)
{
+ attribute->commit(true);
entranceGate->countDown();
exitGate->await();
}
@@ -51,7 +52,7 @@ ExclusiveAttributeReadAccessor::takeGuard()
GateSP entranceGate = std::make_shared<Gate>();
GateSP exitGate = std::make_shared<Gate>();
_attributeFieldWriter.execute(_attributeFieldWriter.getExecutorId(_attribute->getNamePrefix()),
- [entranceGate, exitGate]() { attributeWriteBlockingTask(entranceGate, exitGate); });
+ [this, entranceGate, exitGate]() { attributeWriteBlockingTask(_attribute, entranceGate, exitGate); });
entranceGate->await();
return std::make_unique<Guard>(*_attribute, exitGate);
}