summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-06-03 10:24:32 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-06-03 10:24:32 +0000
commitfd4d64a1e2f7db590fee36571a8ab273d684f69f (patch)
tree99e8f43de1d85006891e5ccab3539c7b66cd4a7f /searchcore
parent6e95ebbf56301af499a88bde7a8ca5fb8393f7b0 (diff)
Take read guard before creating match context.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/matchview.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/matchview.cpp b/searchcore/src/vespa/searchcore/proton/server/matchview.cpp
index 7ba9b971715..61b37a47d09 100644
--- a/searchcore/src/vespa/searchcore/proton/server/matchview.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/matchview.cpp
@@ -58,7 +58,6 @@ MatchView::getMatcher(const vespalib::string & rankProfile) const
return retval;
}
-
MatchContext::UP
MatchView::createContext() const {
IAttributeContext::UP attrCtx = _attrMgr->createContext();
@@ -66,7 +65,6 @@ MatchView::createContext() const {
return std::make_unique<MatchContext>(std::move(attrCtx), std::move(searchCtx));
}
-
std::unique_ptr<SearchReply>
MatchView::match(std::shared_ptr<const ISearchHandler> searchHandler, const SearchRequest &req,
vespalib::ThreadBundle &threadBundle) const
@@ -74,13 +72,12 @@ MatchView::match(std::shared_ptr<const ISearchHandler> searchHandler, const Sear
Matcher::SP matcher = getMatcher(req.ranking);
SearchSession::OwnershipBundle owned_objects;
owned_objects.search_handler = std::move(searchHandler);
+ owned_objects.readGuard = _metaStore->getReadGuard();
owned_objects.context = createContext();
- owned_objects.readGuard = _metaStore->getReadGuard();;
MatchContext *ctx = owned_objects.context.get();
const search::IDocumentMetaStore & dms = owned_objects.readGuard->get();
return matcher->match(req, threadBundle, ctx->getSearchContext(), ctx->getAttributeContext(),
*_sessionMgr, dms, std::move(owned_objects));
}
-
} // namespace proton