summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHÃ¥vard Pettersen <3535158+havardpe@users.noreply.github.com>2021-10-15 11:32:02 +0200
committerGitHub <noreply@github.com>2021-10-15 11:32:02 +0200
commitf2781d1ecbbaf1214463e76eca3359a386d23d70 (patch)
tree1e44fce8045460b95d417eed301d66b83005bb84
parent645391a0ed37434247550ccf4711261fae4b222a (diff)
parent8fa4c52b38ec07a0d312f40dd9e1c5aa0332313e (diff)
Merge pull request #19561 from vespa-engine/havardpe/more-issues
report more issues
-rw-r--r--searchcore/src/vespa/searchcore/grouping/groupingmanager.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/querynodes.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/requestcontext.cpp8
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchview.cpp4
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp4
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/docsumstate.cpp10
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.cpp5
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/geoposdfw.cpp4
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/struct_fields_resolver.cpp8
10 files changed, 36 insertions, 19 deletions
diff --git a/searchcore/src/vespa/searchcore/grouping/groupingmanager.cpp b/searchcore/src/vespa/searchcore/grouping/groupingmanager.cpp
index 42c5d16162e..f5dac65dfc4 100644
--- a/searchcore/src/vespa/searchcore/grouping/groupingmanager.cpp
+++ b/searchcore/src/vespa/searchcore/grouping/groupingmanager.cpp
@@ -60,9 +60,7 @@ GroupingManager::init(const IAttributeContext &attrCtx)
grouping.configureStaticStuff(stuff);
list.push_back(groupingList[i]);
} catch (const std::exception & e) {
- auto msg = fmt("Could not locate attribute for grouping number %ld : %s. Ignoring grouping '%s'", i, e.what(), grouping.asString().c_str());
- Issue::report(msg);
- LOG(error, "%s", msg.c_str());
+ Issue::report("Could not locate attribute for grouping number %ld : %s. Ignoring grouping '%s'", i, e.what(), grouping.asString().c_str());
}
}
std::swap(list, groupingList);
diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp
index ba812e6c79e..dfaf56e09f3 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp
@@ -9,6 +9,7 @@
#include <vespa/searchlib/attribute/diversity.h>
#include <vespa/searchlib/attribute/attribute_operation.h>
#include <vespa/searchlib/attribute/attribute_blueprint_params.h>
+#include <vespa/vespalib/util/issue.h>
#include <vespa/log/log.h>
LOG_SETUP(".proton.matching.match_tools");
@@ -19,6 +20,7 @@ using search::queryeval::IDiversifier;
using search::attribute::diversity::DiversityFilter;
using search::attribute::BasicType;
using search::attribute::AttributeBlueprintParams;
+using vespalib::Issue;
using namespace search::fef;
using namespace search::fef::indexproperties::matchphase;
@@ -234,7 +236,7 @@ MatchToolsFactory::createDiversifier(uint32_t heapSize) const
}
auto attr = _requestContext.getAttribute(_diversityParams.attribute);
if ( !attr) {
- LOG(warning, "Skipping diversity due to no %s attribute.", _diversityParams.attribute.c_str());
+ Issue::report("Skipping diversity due to no %s attribute.", _diversityParams.attribute.c_str());
return std::unique_ptr<IDiversifier>();
}
size_t max_per_group = heapSize/_diversityParams.min_groups;
diff --git a/searchcore/src/vespa/searchcore/proton/matching/querynodes.cpp b/searchcore/src/vespa/searchcore/proton/matching/querynodes.cpp
index 5c5ea116844..661da4273f8 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/querynodes.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/querynodes.cpp
@@ -6,6 +6,7 @@
#include "handlerecorder.h"
#include <vespa/searchlib/query/tree/templatetermvisitor.h>
#include <vespa/searchlib/queryeval/orsearch.h>
+#include <vespa/vespalib/util/issue.h>
#include <vespa/log/log.h>
LOG_SETUP(".proton.matching.querynodes");
@@ -25,6 +26,7 @@ using search::queryeval::SearchIterator;
using std::map;
using std::vector;
using vespalib::string;
+using vespalib::Issue;
namespace proton::matching {
@@ -71,7 +73,7 @@ ProtonTermData::resolveFromChildren(const std::vector<Node *> &subterms)
for (size_t i = 0; i < subterms.size(); ++i) {
const ProtonTermData *child = termDataFromNode(*subterms[i]);
if (child == 0) {
- LOG(warning, "child of equiv is not a term");
+ Issue::report("child of equiv is not a term");
continue;
}
for (size_t j = 0; j < child->numFields(); ++j) {
diff --git a/searchcore/src/vespa/searchcore/proton/matching/requestcontext.cpp b/searchcore/src/vespa/searchcore/proton/matching/requestcontext.cpp
index b1bbd0c4b3d..055ee586856 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/requestcontext.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/requestcontext.cpp
@@ -7,11 +7,13 @@
#include <vespa/searchlib/fef/properties.h>
#include <vespa/vespalib/objects/nbostream.h>
#include <vespa/vespalib/util/exceptions.h>
+#include <vespa/vespalib/util/issue.h>
#include <vespa/log/log.h>
LOG_SETUP(".proton.matching.requestcontext");
using vespalib::eval::FastValueBuilderFactory;
+using vespalib::Issue;
namespace proton {
@@ -54,9 +56,9 @@ RequestContext::get_query_tensor(const vespalib::string& tensor_name) const
vespalib::nbostream stream(value.data(), value.size());
try {
return decode_value(stream, FastValueBuilderFactory::get());
- } catch (vespalib::Exception& ex) {
- LOG(warning, "Query tensor '%s' could not be deserialized: %s",
- tensor_name.c_str(), ex.getMessage().c_str());
+ } catch (vespalib::eval::DecodeValueException& ex) {
+ Issue::report("Query tensor '%s' could not be deserialized: %s",
+ tensor_name.c_str(), ex.getMessage().c_str());
return {};
}
}
diff --git a/searchcore/src/vespa/searchcore/proton/server/searchview.cpp b/searchcore/src/vespa/searchcore/proton/server/searchview.cpp
index b1e350f0b5e..896900c3a82 100644
--- a/searchcore/src/vespa/searchcore/proton/server/searchview.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/searchview.cpp
@@ -4,6 +4,7 @@
#include <vespa/searchcore/proton/docsummary/docsumcontext.h>
#include <vespa/searchlib/engine/searchreply.h>
#include <vespa/vespalib/data/slime/slime.h>
+#include <vespa/vespalib/util/issue.h>
#include <vespa/log/log.h>
LOG_SETUP(".proton.server.searchview");
@@ -18,6 +19,7 @@ using search::engine::DocsumReply;
using search::engine::DocsumRequest;
using search::engine::SearchReply;
using vespalib::ThreadBundle;
+using vespalib::Issue;
namespace proton {
@@ -104,7 +106,7 @@ SearchView::getDocsums(const DocsumRequest & req)
{
LOG(spam, "getDocsums(): resultClass(%s), numHits(%zu)", req.resultClassName.c_str(), req.hits.size());
if (_summarySetup->getResultConfig(). LookupResultClassId(req.resultClassName.c_str()) == ResultConfig::NoClassID()) {
- LOG(warning, "There is no summary class with name '%s' in the summary config. Returning empty document summary for %zu hit(s)",
+ Issue::report("There is no summary class with name '%s' in the summary config. Returning empty document summary for %zu hit(s)",
req.resultClassName.c_str(), req.hits.size());
return createEmptyReply(req);
}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp b/searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp
index 36ebadaa2a2..6dd952f87ef 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp
@@ -14,6 +14,7 @@
#include <vespa/searchlib/tensor/i_tensor_attribute.h>
#include <vespa/vespalib/data/slime/slime.h>
#include <vespa/vespalib/objects/nbostream.h>
+#include <vespa/vespalib/util/issue.h>
#include <vespa/log/log.h>
LOG_SETUP(".searchlib.docsummary.attributedfw");
@@ -27,6 +28,7 @@ using vespalib::slime::Cursor;
using vespalib::slime::Inserter;
using vespalib::slime::Symbol;
using vespalib::eval::Value;
+using vespalib::Issue;
namespace search::docsummary {
@@ -296,7 +298,7 @@ AttributeDFWFactory::create(IAttributeManager& attr_mgr,
auto ctx = attr_mgr.createContext();
const auto* attr = ctx->getAttribute(attr_name);
if (attr == nullptr) {
- LOG(warning, "No valid attribute vector found: '%s'", attr_name.c_str());
+ Issue::report("No valid attribute vector found: '%s'", attr_name.c_str());
return std::unique_ptr<IDocsumFieldWriter>();
}
if (attr->hasMultiValue()) {
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/docsumstate.cpp b/searchsummary/src/vespa/searchsummary/docsummary/docsumstate.cpp
index 4e551078c0b..31d174c72a8 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/docsumstate.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/docsumstate.cpp
@@ -10,6 +10,7 @@
#include <vespa/searchlib/common/matching_elements.h>
#include <vespa/searchlib/parsequery/parse.h>
#include <vespa/searchlib/parsequery/stackdumpiterator.h>
+#include <vespa/vespalib/util/issue.h>
#include "docsum_field_writer_state.h"
#include <vespa/log/log.h>
@@ -17,6 +18,7 @@ LOG_SETUP(".searchsummary.docsummary.docsumstate");
using search::common::GeoLocationParser;
using search::common::GeoLocationSpec;
+using vespalib::Issue;
namespace search::docsummary {
@@ -92,8 +94,8 @@ GetDocsumsState::parse_locations()
GeoLocationSpec spec{attr_name, parser.getGeoLocation()};
_parsedLocations.push_back(spec);
} else {
- LOG(warning, "could not parse location string '%s' from request",
- _args.getLocation().c_str());
+ Issue::report("could not parse location string '%s' from request",
+ _args.getLocation().c_str());
}
}
auto stackdump = _args.getStackDump();
@@ -109,8 +111,8 @@ GetDocsumsState::parse_locations()
GeoLocationSpec spec{attr_name, parser.getGeoLocation()};
_parsedLocations.push_back(spec);
} else {
- LOG(warning, "could not parse location string '%s' from stack dump",
- term.c_str());
+ Issue::report("could not parse location string '%s' from stack dump",
+ term.c_str());
}
}
}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.cpp b/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.cpp
index 00c40baefbc..766ebdc51f4 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.cpp
@@ -7,11 +7,13 @@
#include <vespa/searchlib/util/slime_output_raw_buf_adapter.h>
#include <vespa/searchlib/attribute/iattributemanager.h>
#include <vespa/vespalib/data/slime/slime.h>
+#include <vespa/vespalib/util/issue.h>
#include <vespa/log/log.h>
LOG_SETUP(".searchlib.docsummary.docsumwriter");
using namespace vespalib::slime::convenience;
+using vespalib::Issue;
namespace search::docsummary {
@@ -46,7 +48,8 @@ DynamicDocsumWriter::resolveOutputClass(vespalib::stringref summaryClass) const
if (id != ResultConfig::NoClassID()) {
const ResultClass *oC = _resultConfig->LookupResultClass(id);
if (oC == nullptr) {
- LOG(warning, "Illegal docsum class requested: %d, using empty docsum for documents", id);
+ Issue::report("Illegal docsum class requested: %s, using empty docsum for documents",
+ vespalib::string(summaryClass).c_str());
result.mustSkip = true;
} else {
result.outputClass = oC;
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/geoposdfw.cpp b/searchsummary/src/vespa/searchsummary/docsummary/geoposdfw.cpp
index 35808ffdd6f..1f73872af6e 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/geoposdfw.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/geoposdfw.cpp
@@ -7,6 +7,7 @@
#include <vespa/vespalib/util/jsonwriter.h>
#include <vespa/vespalib/data/slime/cursor.h>
#include <vespa/vespalib/stllike/asciistream.h>
+#include <vespa/vespalib/util/issue.h>
#include <climits>
#include <vespa/log/log.h>
@@ -16,6 +17,7 @@ namespace search::docsummary {
using attribute::IAttributeVector;
using attribute::IAttributeContext;
+using vespalib::Issue;
GeoPositionDFW::GeoPositionDFW(const vespalib::string & attrName) :
AttrDFW(attrName)
@@ -100,7 +102,7 @@ GeoPositionDFW::create(const char *attribute_name,
}
const IAttributeVector *attribute = context->getAttribute(attribute_name);
if (!attribute) {
- LOG(warning, "create: could not get attribute '%s' from context", attribute_name);
+ Issue::report("GeoPositionDFW::create: could not get attribute '%s' from context", attribute_name);
return ret;
}
}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/struct_fields_resolver.cpp b/searchsummary/src/vespa/searchsummary/docsummary/struct_fields_resolver.cpp
index 9caad947335..74163074973 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/struct_fields_resolver.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/struct_fields_resolver.cpp
@@ -3,6 +3,7 @@
#include "struct_fields_resolver.h"
#include <vespa/searchcommon/attribute/iattributecontext.h>
#include <vespa/searchlib/common/matching_elements_fields.h>
+#include <vespa/vespalib/util/issue.h>
#include <algorithm>
#include <vespa/log/log.h>
@@ -10,6 +11,7 @@ LOG_SETUP(".searchsummary.docsummary.struct_fields_resolver");
using search::attribute::CollectionType;
using search::attribute::IAttributeContext;
+using vespalib::Issue;
namespace search::docsummary {
@@ -37,7 +39,7 @@ StructFieldsResolver::StructFieldsResolver(const vespalib::string& field_name, c
continue;
}
if (attr->getCollectionType() != CollectionType::Type::ARRAY) {
- LOG(warning, "Attribute '%s' is not an array attribute", name.c_str());
+ Issue::report("StructFieldsResolver: Attribute '%s' is not an array attribute", name.c_str());
_error = true;
break;
}
@@ -65,10 +67,10 @@ StructFieldsResolver::StructFieldsResolver(const vespalib::string& field_name, c
if (require_all_struct_fields_as_attribute && !_map_value_fields.empty()) {
if (!_has_map_key) {
- LOG(warning, "Missing key attribute '%s', have value attributes for map", _map_key_attribute.c_str());
+ Issue::report("StructFieldsResolver: Missing key attribute '%s', have value attributes for map", _map_key_attribute.c_str());
_error = true;
} else if (_array_fields.size() != 1u) {
- LOG(warning, "Could not determine if field '%s' is array or map of struct", field_name.c_str());
+ Issue::report("StructFieldsResolver: Could not determine if field '%s' is array or map of struct", field_name.c_str());
_error = true;
}
}