summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-11-19 08:06:42 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2021-11-19 14:01:50 +0000
commit97792f2617f1112075a6c696f937e165b28a590d (patch)
treec403b04f3ed04869222760acbf24f705f7a271db /searchcore
parentfd39ddfb9ef7e3fa25da2c7139152b75e48e4642 (diff)
Avoid sync_all in AttributeWriter destructor.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp7
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/attribute_writer_factory.h4
2 files changed, 8 insertions, 3 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp
index ba7bf2cfb37..37aa83f5f7c 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp
@@ -674,7 +674,12 @@ void AttributeWriter::setupAttributeMapping() {
AttributeWriter::~AttributeWriter()
{
- _attributeFieldWriter.sync_all();
+ vespalib::Gate gate;
+ auto onDone = std::make_shared<vespalib::GateCallback>(gate);
+ for (const auto &wc : _writeContexts) {
+ _attributeFieldWriter.executeLambda(wc.getExecutorId(), [onDone] () { (void) onDone; });
+ }
+ gate.await();
}
std::vector<search::AttributeVector *>
diff --git a/searchcore/src/vespa/searchcore/proton/server/attribute_writer_factory.h b/searchcore/src/vespa/searchcore/proton/server/attribute_writer_factory.h
index 55d0cd479e3..d95dfd1314e 100644
--- a/searchcore/src/vespa/searchcore/proton/server/attribute_writer_factory.h
+++ b/searchcore/src/vespa/searchcore/proton/server/attribute_writer_factory.h
@@ -13,8 +13,8 @@ namespace proton {
struct AttributeWriterFactory : public IAttributeWriterFactory
{
AttributeWriterFactory() {}
- virtual IAttributeWriter::SP create(const IAttributeWriter::SP &old,
- const AttributeCollectionSpec &attrSpec) const override
+ IAttributeWriter::SP create(const IAttributeWriter::SP &old,
+ const AttributeCollectionSpec &attrSpec) const override
{
const AttributeWriter &oldAdapter = dynamic_cast<const AttributeWriter &>(*old.get());
const proton::IAttributeManager::SP &oldMgr = oldAdapter.getAttributeManager();