aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-09-20 09:34:51 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-09-20 09:43:17 +0000
commit3c7ed3681f497c846007074a6a2c0509a5b34f88 (patch)
tree713f2fc856ec734ea2384f08f91a1d056ec5b721 /searchcore
parentb572b42a0f757e282a4b063ee75c5d21b25d55bd (diff)
Return early with error if timed out during query setup.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/matcher.cpp4
3 files changed, 8 insertions, 1 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp b/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp
index c3f52dafdd6..8f4d1a2efb9 100644
--- a/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp
@@ -161,7 +161,9 @@ MatchEngine::performSearch(SearchRequest::Source req)
auto capture_issues = vespalib::Issue::listen(*my_issues);
const SearchRequest * searchRequest = req.get();
- auto ret = (searchRequest) ? doSearch(*searchRequest) : std::make_unique<SearchReply>();
+ auto ret = (searchRequest)
+ ? doSearch(*searchRequest)
+ : std::make_unique<SearchReply>();
ret->request = req.release();
if (_forward_issues) {
ret->my_issues = std::move(my_issues);
diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp
index a353d4816f6..f62f4c60a6c 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp
@@ -187,6 +187,7 @@ MatchToolsFactory(QueryLimiter & queryLimiter,
_diversityParams(),
_valid(false)
{
+ if (doom.soft_doom()) return;
auto trace = root_trace.make_trace();
trace.addEvent(4, "Start query setup");
_query.setWhiteListBlueprint(metaStore.createWhiteListBlueprint());
diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
index 4a4a021d6d5..eef0eb48738 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
@@ -278,6 +278,10 @@ Matcher::match(const SearchRequest &request, vespalib::ThreadBundle &threadBundl
if (!mtf->valid()) {
return reply;
}
+ if (mtf->get_request_context().getDoom().soft_doom()) {
+ vespalib::Issue::report("Search request soft doomed during query setup and initialization.");
+ return reply;
+ }
const Properties & rankProperties = request.propertiesMap.rankProperties();
uint32_t heapSize = HeapSize::lookup(rankProperties, _rankSetup->getHeapSize());