aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/attribute
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-02-14 17:01:58 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2021-02-14 17:01:58 +0000
commit66e66d08e509a4eabf394442bcd7e733e228fb25 (patch)
treee9aa07ff8e2debfc93c5e430377848779b315cd5 /searchcore/src/tests/proton/attribute
parent76b1a42ae483ae66a2d1e43ef749f41661754e1c (diff)
When making callbacks like notifying about new bucket show the gurad that is held.
Then this guard can used instead of possibly making a deadlock if trying to take it yourself.
Diffstat (limited to 'searchcore/src/tests/proton/attribute')
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp7
-rw-r--r--searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp8
2 files changed, 9 insertions, 6 deletions
diff --git a/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp b/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp
index 3987a8685ea..ef2c3c18753 100644
--- a/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp
@@ -12,6 +12,7 @@
#include <vespa/searchcore/proton/attribute/imported_attributes_repo.h>
#include <vespa/searchcore/proton/attribute/sequential_attributes_initializer.h>
#include <vespa/searchcore/proton/common/hw_info.h>
+#include <vespa/searchcore/proton/bucketdb/bucket_db_owner.h>
#include <vespa/searchcore/proton/documentmetastore/documentmetastorecontext.h>
#include <vespa/searchcore/proton/flushengine/shrink_lid_space_flush_target.h>
#include <vespa/searchcore/proton/initializer/initializer_task.h>
@@ -140,7 +141,7 @@ struct ImportedAttributesRepoBuilder {
refAttr->setGidToLidMapperFactory(std::make_shared<MockGidToLidMapperFactory>());
auto targetAttr = search::AttributeFactory::createAttribute(name + "_target", INT32_SINGLE);
auto documentMetaStore = std::shared_ptr<search::IDocumentMetaStoreContext>();
- auto targetDocumentMetaStore = std::make_shared<const DocumentMetaStoreContext>(std::make_shared<BucketDBOwner>());
+ auto targetDocumentMetaStore = std::make_shared<const DocumentMetaStoreContext>(std::make_shared<bucketdb::BucketDBOwner>());
auto importedAttr = ImportedAttributeVectorFactory::create(name, refAttr, documentMetaStore, targetAttr, targetDocumentMetaStore, false);
_repo->add(name, importedAttr);
}
@@ -230,7 +231,7 @@ struct DummyInitializerTask : public InitializerTask
struct ParallelAttributeManager
{
InitializerTask::SP documentMetaStoreInitTask;
- BucketDBOwner::SP bucketDbOwner;
+ std::shared_ptr<bucketdb::BucketDBOwner> bucketDbOwner;
DocumentMetaStore::SP documentMetaStore;
AllocStrategy alloc_strategy;
bool fastAccessAttributesOnly;
@@ -247,7 +248,7 @@ struct ParallelAttributeManager
ParallelAttributeManager::ParallelAttributeManager(search::SerialNum configSerialNum, AttributeManager::SP baseAttrMgr,
const AttributesConfig &attrCfg, uint32_t docIdLimit)
: documentMetaStoreInitTask(std::make_shared<DummyInitializerTask>()),
- bucketDbOwner(std::make_shared<BucketDBOwner>()),
+ bucketDbOwner(std::make_shared<bucketdb::BucketDBOwner>()),
documentMetaStore(std::make_shared<DocumentMetaStore>(bucketDbOwner)),
alloc_strategy(),
fastAccessAttributesOnly(false),
diff --git a/searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp b/searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp
index 494b37297f4..fa08df6faa1 100644
--- a/searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp
+++ b/searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp
@@ -1,11 +1,11 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/log/log.h>
-LOG_SETUP("imported_attributes_context_test");
+
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchcore/proton/attribute/imported_attributes_context.h>
#include <vespa/searchcore/proton/attribute/imported_attributes_repo.h>
#include <vespa/searchcore/proton/documentmetastore/documentmetastorecontext.h>
+#include <vespa/searchcore/proton/bucketdb/bucket_db_owner.h>
#include <vespa/searchlib/attribute/attribute.h>
#include <vespa/searchlib/attribute/attributefactory.h>
#include <vespa/searchlib/attribute/imported_attribute_vector.h>
@@ -14,6 +14,8 @@ LOG_SETUP("imported_attributes_context_test");
#include <vespa/searchlib/test/mock_gid_to_lid_mapping.h>
#include <future>
+#include <vespa/log/log.h>
+LOG_SETUP("imported_attributes_context_test");
using namespace proton;
using search::AttributeVector;
using search::attribute::BasicType;
@@ -80,7 +82,7 @@ struct Fixture {
createReferenceAttribute(name + "_ref"),
std::shared_ptr<search::IDocumentMetaStoreContext>(),
createTargetAttribute(name + "_target"),
- std::make_shared<const DocumentMetaStoreContext>(std::make_shared<BucketDBOwner>()),
+ std::make_shared<const DocumentMetaStoreContext>(std::make_shared<bucketdb::BucketDBOwner>()),
false);
repo.add(name, attr);
return *this;