diff options
author | Harald Musum <musum@yahooinc.com> | 2021-12-12 09:23:54 +0100 |
---|---|---|
committer | Harald Musum <musum@yahooinc.com> | 2021-12-12 09:23:54 +0100 |
commit | 415b8df2bab22b597cdaefb8133c009eff026dd1 (patch) | |
tree | e384e5cb346e544974972f06242775349c03d5a5 | |
parent | bc117aa5fd1aaa54ae8c86c103899bc81b5d481f (diff) | |
parent | c2523f853ce2190dd50caf1f5a661baf50475db3 (diff) |
Merge branch 'master' into revert-20366-revert-20350-hmusum/config-subscription-refactoring-part-5
49 files changed, 110 insertions, 67 deletions
diff --git a/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/RpcConfigSourceClient.java b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/RpcConfigSourceClient.java index e6a3d66f340..56fdae477b2 100644 --- a/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/RpcConfigSourceClient.java +++ b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/RpcConfigSourceClient.java @@ -17,6 +17,7 @@ import com.yahoo.vespa.config.TimingValues; import com.yahoo.vespa.config.protocol.JRTServerConfigRequest; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Optional; @@ -45,7 +46,8 @@ class RpcConfigSourceClient implements ConfigSourceClient, Runnable { private final ResponseHandler responseHandler; private final ConfigSourceSet configSourceSet; - private final Map<ConfigCacheKey, Subscriber> activeSubscribers = new ConcurrentHashMap<>(); + private final Object subscribersLock = new Object(); + private final Map<ConfigCacheKey, Subscriber> subscribers = new ConcurrentHashMap<>(); private final MemoryCache memoryCache; private final DelayedResponses delayedResponses; private final ScheduledExecutorService nextConfigScheduler = @@ -139,22 +141,29 @@ class RpcConfigSourceClient implements ConfigSourceClient, Runnable { } private void subscribeToConfig(RawConfig input, ConfigCacheKey configCacheKey) { - if (activeSubscribers.containsKey(configCacheKey)) return; + synchronized (subscribersLock) { + if (subscribers.containsKey(configCacheKey)) return; - log.log(Level.FINE, () -> "Could not find good config in cache, creating subscriber for: " + configCacheKey); - var subscriber = new Subscriber(input, timingValues, requesters.getRequester(configSourceSet, timingValues)); - try { - subscriber.subscribe(); - activeSubscribers.put(configCacheKey, subscriber); - } catch (ConfigurationRuntimeException e) { - log.log(Level.INFO, "Subscribe for '" + configCacheKey + "' failed, closing subscriber"); - subscriber.cancel(); + log.log(Level.FINE, () -> "Could not find good config in cache, creating subscriber for: " + configCacheKey); + var subscriber = new Subscriber(input, timingValues, requesters + .getRequester(configSourceSet, timingValues)); + try { + subscriber.subscribe(); + subscribers.put(configCacheKey, subscriber); + } catch (ConfigurationRuntimeException e) { + log.log(Level.INFO, "Subscribe for '" + configCacheKey + "' failed, closing subscriber"); + subscriber.cancel(); + } } } @Override public void run() { - activeSubscribers.values().forEach(subscriber -> { + Collection<Subscriber> s; + synchronized (subscribersLock) { + s = List.copyOf(subscribers.values()); + } + s.forEach(subscriber -> { if (!subscriber.isClosed()) { Optional<RawConfig> config = subscriber.nextGeneration(); config.ifPresent(this::updateWithNewConfig); @@ -180,8 +189,10 @@ class RpcConfigSourceClient implements ConfigSourceClient, Runnable { @Override public void shutdownSourceConnections() { log.log(Level.FINE, "Subscriber::cancel"); - activeSubscribers.values().forEach(Subscriber::cancel); - activeSubscribers.clear(); + synchronized (subscribers) { + subscribers.values().forEach(Subscriber::cancel); + subscribers.clear(); + } log.log(Level.FINE, "nextConfigFuture.cancel"); nextConfigFuture.cancel(true); log.log(Level.FINE, "nextConfigScheduler.shutdownNow"); diff --git a/container-disc/src/main/sh/vespa-start-container-daemon.sh b/container-disc/src/main/sh/vespa-start-container-daemon.sh index eb446f9a251..5d47392292d 100755 --- a/container-disc/src/main/sh/vespa-start-container-daemon.sh +++ b/container-disc/src/main/sh/vespa-start-container-daemon.sh @@ -19,7 +19,12 @@ cd ${VESPA_HOME} || { echo "Cannot cd to ${VESPA_HOME}" 1>&2; exit 1; } . libexec/vespa/common-env.sh -DISCRIMINATOR=`echo ${VESPA_CONFIG_ID} | md5sum | cut -d' ' -f1` +if test "$(uname -s)" = Darwin +then + DISCRIMINATOR=`echo ${VESPA_CONFIG_ID} | md5 -r | cut -d' ' -f1` +else + DISCRIMINATOR=`echo ${VESPA_CONFIG_ID} | md5sum | cut -d' ' -f1` +fi CONTAINER_HOME="${VESPA_HOME}/var/jdisc_container/${DISCRIMINATOR}/" ZOOKEEPER_LOG_FILE_PREFIX="${VESPA_HOME}/logs/vespa/zookeeper.${VESPA_SERVICE_NAME}" diff --git a/document/src/vespa/document/annotation/alternatespanlist.h b/document/src/vespa/document/annotation/alternatespanlist.h index 92c58135431..f21cafedb41 100644 --- a/document/src/vespa/document/annotation/alternatespanlist.h +++ b/document/src/vespa/document/annotation/alternatespanlist.h @@ -12,7 +12,7 @@ class AlternateSpanList : public SpanNode { struct Subtree { SpanList *span_list; double probability; - Subtree() : span_list(0), probability(0.0) {} + Subtree() noexcept : span_list(0), probability(0.0) {} }; std::vector<Subtree> _subtrees; diff --git a/document/src/vespa/document/annotation/annotation.h b/document/src/vespa/document/annotation/annotation.h index 4acd4d2f045..46e5a1a5d41 100644 --- a/document/src/vespa/document/annotation/annotation.h +++ b/document/src/vespa/document/annotation/annotation.h @@ -22,7 +22,7 @@ public: : _type(&type), _node(nullptr), _value(value.release()) {} Annotation(const AnnotationType &annotation) : _type(&annotation), _node(nullptr), _value(nullptr) { } - Annotation() : _type(nullptr), _node(nullptr), _value(nullptr) { } + Annotation() noexcept : _type(nullptr), _node(nullptr), _value(nullptr) { } ~Annotation(); void setType(const AnnotationType * v) { _type = v; } diff --git a/document/src/vespa/document/annotation/span.h b/document/src/vespa/document/annotation/span.h index ab6f61843d1..5f3a78bf98c 100644 --- a/document/src/vespa/document/annotation/span.h +++ b/document/src/vespa/document/annotation/span.h @@ -14,7 +14,7 @@ class Span : public SpanNode { public: typedef std::unique_ptr<Span> UP; - Span(int32_t from_pos=0, int32_t len=0) : _from(from_pos), _length(len) {} + Span(int32_t from_pos=0, int32_t len=0) noexcept : _from(from_pos), _length(len) {} int32_t from() const { return _from; } int32_t length() const { return _length; } diff --git a/document/src/vespa/document/select/resultset.h b/document/src/vespa/document/select/resultset.h index ef5133807a7..1289f61046c 100644 --- a/document/src/vespa/document/select/resultset.h +++ b/document/src/vespa/document/select/resultset.h @@ -20,7 +20,7 @@ class ResultSet static std::vector<ResultSet> _ors; static std::vector<ResultSet> _nots; public: - ResultSet() : _val(0u) { } + ResultSet() noexcept : _val(0u) { } static uint32_t enumToMask(uint32_t rhs) { return 1u << rhs; diff --git a/documentapi/src/vespa/documentapi/messagebus/policies/loadbalancer.h b/documentapi/src/vespa/documentapi/messagebus/policies/loadbalancer.h index 19975bd9465..6627fc57ef2 100644 --- a/documentapi/src/vespa/documentapi/messagebus/policies/loadbalancer.h +++ b/documentapi/src/vespa/documentapi/messagebus/policies/loadbalancer.h @@ -10,7 +10,7 @@ class LoadBalancer { public: class NodeInfo { public: - NodeInfo() : valid(false), sent(0), busy(0), weight(1.0) {}; + NodeInfo() noexcept : valid(false), sent(0), busy(0), weight(1.0) {}; bool valid; uint32_t sent; diff --git a/eval/src/tests/ann/for-sift-hit.h b/eval/src/tests/ann/for-sift-hit.h index 0c920fe8109..4002dff84ee 100644 --- a/eval/src/tests/ann/for-sift-hit.h +++ b/eval/src/tests/ann/for-sift-hit.h @@ -5,6 +5,6 @@ struct Hit { uint32_t docid; double distance; - Hit() : docid(0u), distance(0.0) {} + Hit() noexcept : docid(0u), distance(0.0) {} Hit(int id, double dist) : docid(id), distance(dist) {} }; diff --git a/eval/src/tests/ann/xp-lsh-nns.cpp b/eval/src/tests/ann/xp-lsh-nns.cpp index bdc61a39610..1557da0b84c 100644 --- a/eval/src/tests/ann/xp-lsh-nns.cpp +++ b/eval/src/tests/ann/xp-lsh-nns.cpp @@ -130,7 +130,7 @@ struct LshHit { double distance; uint32_t docid; int hash_distance; - LshHit() : distance(0.0), docid(0u), hash_distance(0) {} + LshHit() noexcept : distance(0.0), docid(0u), hash_distance(0) {} LshHit(int id, double dist, int hd = 0) : distance(dist), docid(id), hash_distance(hd) {} }; diff --git a/eval/src/vespa/eval/eval/aggr.h b/eval/src/vespa/eval/eval/aggr.h index a932d0ac932..133d9b520cd 100644 --- a/eval/src/vespa/eval/eval/aggr.h +++ b/eval/src/vespa/eval/eval/aggr.h @@ -90,7 +90,7 @@ private: size_t _cnt; public: using value_type = T; - constexpr Avg() : _sum{0}, _cnt{0} {} + constexpr Avg() noexcept : _sum{0}, _cnt{0} {} constexpr Avg(T value) : _sum{value}, _cnt{1} {} constexpr void sample(T value) { _sum += value; @@ -109,7 +109,7 @@ private: size_t _cnt; public: using value_type = T; - constexpr Count() : _cnt{0} {} + constexpr Count() noexcept : _cnt{0} {} constexpr Count(T) : _cnt{1} {} constexpr void sample(T) { ++_cnt; } constexpr void merge(const Count &rhs) { _cnt += rhs._cnt; } @@ -122,7 +122,7 @@ private: T _prod; public: using value_type = T; - constexpr Prod() : _prod{null_value()} {} + constexpr Prod() noexcept : _prod{null_value()} {} constexpr Prod(T value) : _prod{value} {} constexpr void sample(T value) { _prod = combine(_prod, value); } constexpr void merge(const Prod &rhs) { _prod = combine(_prod, rhs._prod); } @@ -137,7 +137,7 @@ private: T _sum; public: using value_type = T; - constexpr Sum() : _sum{null_value()} {} + constexpr Sum() noexcept : _sum{null_value()} {} constexpr Sum(T value) : _sum{value} {} constexpr void sample(T value) { _sum = combine(_sum, value); } constexpr void merge(const Sum &rhs) { _sum = combine(_sum, rhs._sum); } @@ -152,7 +152,7 @@ private: T _max; public: using value_type = T; - constexpr Max() : _max{null_value()} {} + constexpr Max() noexcept : _max{null_value()} {} constexpr Max(T value) : _max{value} {} constexpr void sample(T value) { _max = combine(_max, value); } constexpr void merge(const Max &rhs) { _max = combine(_max, rhs._max); } @@ -167,7 +167,7 @@ private: std::vector<T> _seen; public: using value_type = T; - constexpr Median() : _seen() {} + constexpr Median() noexcept : _seen() {} constexpr Median(T value) : _seen({value}) {} constexpr void sample(T value) { _seen.push_back(value); } constexpr void merge(const Median &rhs) { @@ -205,7 +205,7 @@ private: T _min; public: using value_type = T; - constexpr Min() : _min{null_value()} {} + constexpr Min() noexcept : _min{null_value()} {} constexpr Min(T value) : _min{value} {} constexpr void sample(T value) { _min = combine(_min, value); } constexpr void merge(const Min &rhs) { _min = combine(_min, rhs._min); } diff --git a/fsa/src/vespa/fsa/vectorizer.h b/fsa/src/vespa/fsa/vectorizer.h index 3dead2faa2e..6ce94e92569 100644 --- a/fsa/src/vespa/fsa/vectorizer.h +++ b/fsa/src/vespa/fsa/vectorizer.h @@ -49,7 +49,7 @@ public: /** * @brief Default constructor, creates empty item with zero weight. */ - VectorItem() : _term(), _weight(0.0), _hits() {} + VectorItem() noexcept : _term(), _weight(0.0), _hits() {} /** * @brief Copy constructor. diff --git a/persistence/src/vespa/persistence/spi/result.cpp b/persistence/src/vespa/persistence/spi/result.cpp index 2e24c9c2f91..e458d58fe69 100644 --- a/persistence/src/vespa/persistence/spi/result.cpp +++ b/persistence/src/vespa/persistence/spi/result.cpp @@ -8,7 +8,9 @@ namespace storage::spi { Result::Result(const Result &) = default; +Result::Result(Result&&) noexcept = default; Result & Result::operator = (const Result &) = default; +Result& Result::operator=(Result&&) noexcept = default; Result::~Result() = default; vespalib::string diff --git a/persistence/src/vespa/persistence/spi/result.h b/persistence/src/vespa/persistence/spi/result.h index 70bd37590a1..c734a885b12 100644 --- a/persistence/src/vespa/persistence/spi/result.h +++ b/persistence/src/vespa/persistence/spi/result.h @@ -36,7 +36,9 @@ public: {} Result(const Result &); + Result(Result&&) noexcept; Result & operator = (const Result &); + Result& operator=(Result&&) noexcept; virtual ~Result(); diff --git a/searchcommon/src/vespa/searchcommon/attribute/hnsw_index_params.h b/searchcommon/src/vespa/searchcommon/attribute/hnsw_index_params.h index 77e994daa85..4f9d3c5593c 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/hnsw_index_params.h +++ b/searchcommon/src/vespa/searchcommon/attribute/hnsw_index_params.h @@ -22,7 +22,7 @@ public: HnswIndexParams(uint32_t max_links_per_node_in, uint32_t neighbors_to_explore_at_insert_in, DistanceMetric distance_metric_in, - bool multi_threaded_indexing_in = false) + bool multi_threaded_indexing_in = false) noexcept : _max_links_per_node(max_links_per_node_in), _neighbors_to_explore_at_insert(neighbors_to_explore_at_insert_in), _distance_metric(distance_metric_in), diff --git a/searchcore/src/vespa/searchcore/proton/matching/docid_range_scheduler.h b/searchcore/src/vespa/searchcore/proton/matching/docid_range_scheduler.h index f51043e9960..4aa8a3f6392 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/docid_range_scheduler.h +++ b/searchcore/src/vespa/searchcore/proton/matching/docid_range_scheduler.h @@ -174,7 +174,7 @@ private: std::condition_variable condition; bool is_idle; DocidRange next_range; - Worker() : condition(), is_idle(false), next_range() {} + Worker() noexcept : condition(), is_idle(false), next_range() {} }; DocidRangeSplitter _splitter; uint32_t _min_task; diff --git a/searchcore/src/vespa/searchcore/proton/matching/matching_stats.h b/searchcore/src/vespa/searchcore/proton/matching/matching_stats.h index 7cdf8991fb4..047c6fcaf13 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matching_stats.h +++ b/searchcore/src/vespa/searchcore/proton/matching/matching_stats.h @@ -67,7 +67,7 @@ public: Avg _wait_time; friend MatchingStats; public: - Partition() + Partition() noexcept : _docsCovered(0), _docsMatched(0), _docsRanked(0), diff --git a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h index 8040433dbde..8572f7126d6 100644 --- a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h +++ b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h @@ -6,6 +6,7 @@ #include <vespa/searchcorespi/index/ithreadingservice.h> #include <vespa/vespalib/util/threadstackexecutor.h> #include <vespa/vespalib/util/invokeservice.h> +#include <atomic> namespace proton { diff --git a/searchlib/src/vespa/searchlib/aggregation/fs4hit.h b/searchlib/src/vespa/searchlib/aggregation/fs4hit.h index 135bbe44887..7cb078fe7e8 100644 --- a/searchlib/src/vespa/searchlib/aggregation/fs4hit.h +++ b/searchlib/src/vespa/searchlib/aggregation/fs4hit.h @@ -19,7 +19,7 @@ private: public: DECLARE_IDENTIFIABLE_NS2(search, aggregation, FS4Hit); DECLARE_NBO_SERIALIZE; - FS4Hit() : Hit(), _path(0), _docId(0), _globalId(), _distributionKey(-1) {} + FS4Hit() noexcept : Hit(), _path(0), _docId(0), _globalId(), _distributionKey(-1) {} FS4Hit(DocId docId, HitRank rank) : Hit(rank), _path(0), _docId(docId), _globalId(), _distributionKey(-1) {} FS4Hit *clone() const override { return new FS4Hit(*this); } diff --git a/searchlib/src/vespa/searchlib/common/indexmetainfo.h b/searchlib/src/vespa/searchlib/common/indexmetainfo.h index 9b6c7c8e477..2ba8bebb698 100644 --- a/searchlib/src/vespa/searchlib/common/indexmetainfo.h +++ b/searchlib/src/vespa/searchlib/common/indexmetainfo.h @@ -15,7 +15,7 @@ public: bool valid; uint64_t syncToken; vespalib::string dirName; - Snapshot() : valid(false), syncToken(0), dirName() {} + Snapshot() noexcept : valid(false), syncToken(0), dirName() {} Snapshot(bool valid_, uint64_t syncToken_, const vespalib::string &dirName_) : valid(valid_), syncToken(syncToken_), dirName(dirName_) {} bool operator==(const Snapshot &rhs) const { diff --git a/searchlib/src/vespa/searchlib/diskindex/field_length_scanner.h b/searchlib/src/vespa/searchlib/diskindex/field_length_scanner.h index 181607c3fc6..1feabed1eb1 100644 --- a/searchlib/src/vespa/searchlib/diskindex/field_length_scanner.h +++ b/searchlib/src/vespa/searchlib/diskindex/field_length_scanner.h @@ -23,7 +23,7 @@ class FieldLengthScanner { static uint16_t make_element_mask(uint32_t element_id) { return (1u << element_id); } public: - FieldLengthEntry() + FieldLengthEntry() noexcept : _field_length(0), _elements(0) { diff --git a/searchlib/src/vespa/searchlib/docstore/chunk.h b/searchlib/src/vespa/searchlib/docstore/chunk.h index d40ba27ef45..1190f40aa97 100644 --- a/searchlib/src/vespa/searchlib/docstore/chunk.h +++ b/searchlib/src/vespa/searchlib/docstore/chunk.h @@ -47,7 +47,7 @@ private: class LidMeta { public: - LidMeta() : _lid(0), _size(0) { } + LidMeta() noexcept : _lid(0), _size(0) { } LidMeta(uint32_t lid, uint32_t sz) : _lid(lid), _size(sz) { } uint32_t getLid() const { return _lid; } uint32_t size() const { return _size; } diff --git a/searchlib/src/vespa/searchlib/expression/floatbucketresultnode.h b/searchlib/src/vespa/searchlib/expression/floatbucketresultnode.h index 080b4f0fc5c..7b89e90efe9 100644 --- a/searchlib/src/vespa/searchlib/expression/floatbucketresultnode.h +++ b/searchlib/src/vespa/searchlib/expression/floatbucketresultnode.h @@ -33,7 +33,7 @@ public: DECLARE_EXPRESSIONNODE(FloatBucketResultNode); DECLARE_NBO_SERIALIZE; - FloatBucketResultNode() : _from(0.0), _to(0.0) {} + FloatBucketResultNode() noexcept : _from(0.0), _to(0.0) {} FloatBucketResultNode(double from, double to) : _from(from), _to(to) {} size_t hash() const override; int onCmp(const Identifiable & b) const override; diff --git a/searchlib/src/vespa/searchlib/expression/floatresultnode.h b/searchlib/src/vespa/searchlib/expression/floatresultnode.h index 5bff232fe2f..c31f9a2de40 100644 --- a/searchlib/src/vespa/searchlib/expression/floatresultnode.h +++ b/searchlib/src/vespa/searchlib/expression/floatresultnode.h @@ -13,7 +13,7 @@ public: DECLARE_EXPRESSIONNODE(FloatResultNode); DECLARE_NBO_SERIALIZE; void visitMembers(vespalib::ObjectVisitor &visitor) const override; - FloatResultNode(double v=0) : _value(v) { } + FloatResultNode(double v=0) noexcept : _value(v) { } size_t hash() const override { size_t tmpHash(0); memcpy(&tmpHash, &_value, sizeof(tmpHash)); return tmpHash; } int onCmp(const Identifiable & b) const override; void add(const ResultNode & b) override; diff --git a/searchlib/src/vespa/searchlib/expression/integerbucketresultnode.h b/searchlib/src/vespa/searchlib/expression/integerbucketresultnode.h index d5a2306200c..95a4555e6e4 100644 --- a/searchlib/src/vespa/searchlib/expression/integerbucketresultnode.h +++ b/searchlib/src/vespa/searchlib/expression/integerbucketresultnode.h @@ -31,7 +31,7 @@ private: public: DECLARE_EXPRESSIONNODE(IntegerBucketResultNode); DECLARE_NBO_SERIALIZE; - IntegerBucketResultNode() : _from(0), _to(0) {} + IntegerBucketResultNode() noexcept : _from(0), _to(0) {} IntegerBucketResultNode(int64_t from, int64_t to) : _from(from), _to(to) {} size_t hash() const override; int onCmp(const Identifiable & b) const override; diff --git a/searchlib/src/vespa/searchlib/expression/stringresultnode.h b/searchlib/src/vespa/searchlib/expression/stringresultnode.h index b9d127a2e2c..79d849bdd15 100644 --- a/searchlib/src/vespa/searchlib/expression/stringresultnode.h +++ b/searchlib/src/vespa/searchlib/expression/stringresultnode.h @@ -12,7 +12,7 @@ public: DECLARE_EXPRESSIONNODE(StringResultNode); DECLARE_NBO_SERIALIZE; void visitMembers(vespalib::ObjectVisitor &visitor) const override; - StringResultNode(const char * v="") : _value(v) { } + StringResultNode(const char * v="") noexcept : _value(v) { } StringResultNode(vespalib::stringref v) : _value(v) { } size_t hash() const override; int onCmp(const Identifiable & b) const override; diff --git a/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.h b/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.h index 684857e5a7c..d9375f12d54 100644 --- a/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.h +++ b/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.h @@ -14,7 +14,7 @@ namespace search::features { struct NativeFieldMatchParam : public NativeParamBase { static const uint32_t NOT_DEF_FIELD_LENGTH; - NativeFieldMatchParam() : NativeParamBase(), firstOccTable(NULL), numOccTable(NULL), averageFieldLength(NOT_DEF_FIELD_LENGTH), firstOccImportance(0.5) { } + NativeFieldMatchParam() noexcept : NativeParamBase(), firstOccTable(NULL), numOccTable(NULL), averageFieldLength(NOT_DEF_FIELD_LENGTH), firstOccImportance(0.5) { } const fef::Table * firstOccTable; const fef::Table * numOccTable; uint32_t averageFieldLength; diff --git a/searchlib/src/vespa/searchlib/features/nativeproximityfeature.h b/searchlib/src/vespa/searchlib/features/nativeproximityfeature.h index 0c61ddf9bae..e40779dae14 100644 --- a/searchlib/src/vespa/searchlib/features/nativeproximityfeature.h +++ b/searchlib/src/vespa/searchlib/features/nativeproximityfeature.h @@ -13,7 +13,7 @@ namespace search::features { **/ struct NativeProximityParam : public NativeParamBase { - NativeProximityParam() : NativeParamBase(), proximityTable(NULL), revProximityTable(NULL), proximityImportance(0.5) { } + NativeProximityParam() noexcept : NativeParamBase(), proximityTable(NULL), revProximityTable(NULL), proximityImportance(0.5) { } const fef::Table * proximityTable; const fef::Table * revProximityTable; feature_t proximityImportance; diff --git a/searchlib/src/vespa/searchlib/fef/test/ftlib.h b/searchlib/src/vespa/searchlib/fef/test/ftlib.h index 437f2d330ec..d4a18fcd40e 100644 --- a/searchlib/src/vespa/searchlib/fef/test/ftlib.h +++ b/searchlib/src/vespa/searchlib/fef/test/ftlib.h @@ -127,7 +127,7 @@ private: struct FtQueryTerm { FtQueryTerm(const vespalib::string t, uint32_t tw = 100, feature_t co = 0.1f, feature_t si = 0.1f) : term(t), termWeight(tw), connexity(co), significance(si) {} - FtQueryTerm() : term(), termWeight(100), connexity(0.1f), significance(0.1f) {} + FtQueryTerm() noexcept : term(), termWeight(100), connexity(0.1f), significance(0.1f) {} vespalib::string term; search::query::Weight termWeight; feature_t connexity; diff --git a/searchlib/src/vespa/searchlib/grouping/collect.h b/searchlib/src/vespa/searchlib/grouping/collect.h index 6d899723f1a..55b5ea3ddd4 100644 --- a/searchlib/src/vespa/searchlib/grouping/collect.h +++ b/searchlib/src/vespa/searchlib/grouping/collect.h @@ -90,7 +90,7 @@ private: typedef vespalib::Array<ResultAccessor> ResultAccessorList; class SortInfo { public: - SortInfo() : _index(0), _sign(1) { } + SortInfo() noexcept : _index(0), _sign(1) { } SortInfo(uint8_t index, int8_t sign) : _index(index), _sign(sign) { } uint8_t getIndex() const { return _index; } int8_t getSign() const { return _sign; } diff --git a/searchlib/src/vespa/searchlib/grouping/groupref.h b/searchlib/src/vespa/searchlib/grouping/groupref.h index 49e56ed5bed..78331e4caaf 100644 --- a/searchlib/src/vespa/searchlib/grouping/groupref.h +++ b/searchlib/src/vespa/searchlib/grouping/groupref.h @@ -9,7 +9,7 @@ namespace grouping { class GroupRef { public: - GroupRef() : _ref(-1) { } + GroupRef() noexcept : _ref(-1) { } GroupRef(uint32_t ref) : _ref(ref) { } uint32_t getRef() const { return _ref; } bool valid() const { return _ref != static_cast<uint32_t>(-1); } diff --git a/searchlib/src/vespa/searchlib/index/bitvectorkeys.h b/searchlib/src/vespa/searchlib/index/bitvectorkeys.h index cacb0f59721..332b0ed3524 100644 --- a/searchlib/src/vespa/searchlib/index/bitvectorkeys.h +++ b/searchlib/src/vespa/searchlib/index/bitvectorkeys.h @@ -9,7 +9,7 @@ struct BitVectorWordSingleKey { uint32_t _numDocs; uint32_t _pad; - BitVectorWordSingleKey() + BitVectorWordSingleKey() noexcept : _wordNum(0), _numDocs(0), _pad(0) diff --git a/searchlib/src/vespa/searchlib/query/streaming/queryterm.h b/searchlib/src/vespa/searchlib/query/streaming/queryterm.h index 6a64aa561e4..d160db9784e 100644 --- a/searchlib/src/vespa/searchlib/query/streaming/queryterm.h +++ b/searchlib/src/vespa/searchlib/query/streaming/queryterm.h @@ -39,7 +39,7 @@ public: }; class FieldInfo { public: - FieldInfo() : _hitListOffset(0), _hitCount(0), _fieldLength(0) { } + FieldInfo() noexcept : _hitListOffset(0), _hitCount(0), _fieldLength(0) { } FieldInfo(uint32_t hitListOffset, uint32_t hitCount, uint32_t fieldLength) : _hitListOffset(hitListOffset), _hitCount(hitCount), _fieldLength(fieldLength) { } size_t getHitOffset() const { return _hitListOffset; } diff --git a/searchlib/src/vespa/searchlib/transactionlog/ichunk.cpp b/searchlib/src/vespa/searchlib/transactionlog/ichunk.cpp index 99370d263ec..d86d9dc763c 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/ichunk.cpp +++ b/searchlib/src/vespa/searchlib/transactionlog/ichunk.cpp @@ -159,6 +159,9 @@ SerializedChunk::SerializedChunk(std::unique_ptr<CommitChunk> commitChunk, Encod assert(! chunk->getEntries().empty()); encode(_os, *chunk, encoding); } + +SerializedChunk::~SerializedChunk() = default; + vespalib::ConstBufferRef SerializedChunk::getData() const { return vespalib::ConstBufferRef(_os.data(), _os.size()); } diff --git a/searchlib/src/vespa/searchlib/transactionlog/ichunk.h b/searchlib/src/vespa/searchlib/transactionlog/ichunk.h index e5daeb810f4..cf8d12c1feb 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/ichunk.h +++ b/searchlib/src/vespa/searchlib/transactionlog/ichunk.h @@ -42,6 +42,7 @@ public: SerializedChunk(SerializedChunk &&) = default; SerializedChunk & operator=(SerializedChunk &&) = default; SerializedChunk(const SerializedChunk &) = delete; + ~SerializedChunk(); SerializedChunk & operator=(const SerializedChunk &) = delete; vespalib::ConstBufferRef getData() const; SerialNumRange range() const { return _range; } diff --git a/staging_vespalib/src/vespa/vespalib/util/jsonstream.h b/staging_vespalib/src/vespa/vespalib/util/jsonstream.h index fc2ae61b37e..d60151f0478 100644 --- a/staging_vespalib/src/vespa/vespalib/util/jsonstream.h +++ b/staging_vespalib/src/vespa/vespalib/util/jsonstream.h @@ -44,7 +44,7 @@ class JsonStream : public JsonStreamTypes { string object_key; size_t array_index; - StateEntry() + StateEntry() noexcept : state(State::ROOT), object_key(""), array_index(size_t(0)) {} StateEntry(State s) : state(s), object_key(""), array_index(size_t(0)) {} diff --git a/storage/src/vespa/storage/distributor/node_supported_features.h b/storage/src/vespa/storage/distributor/node_supported_features.h index fb9cc68e970..647e063f93e 100644 --- a/storage/src/vespa/storage/distributor/node_supported_features.h +++ b/storage/src/vespa/storage/distributor/node_supported_features.h @@ -13,7 +13,9 @@ namespace storage::distributor { struct NodeSupportedFeatures { bool unordered_merge_chaining = false; - bool operator==(const NodeSupportedFeatures&) const noexcept = default; + bool operator==(const NodeSupportedFeatures& rhs) const noexcept { + return unordered_merge_chaining == rhs.unordered_merge_chaining; + }; }; } diff --git a/storage/src/vespa/storage/persistence/filestorage/filestormanager.cpp b/storage/src/vespa/storage/persistence/filestorage/filestormanager.cpp index fc87845315f..2cfb3a2cffe 100644 --- a/storage/src/vespa/storage/persistence/filestorage/filestormanager.cpp +++ b/storage/src/vespa/storage/persistence/filestorage/filestormanager.cpp @@ -886,11 +886,14 @@ namespace { bool FileStorManager::maintenance_in_all_spaces(const lib::Node& node) const noexcept { - return std::ranges::all_of(_component.getBucketSpaceRepo(), [&](const auto& elem) { + for (auto& elem : _component.getBucketSpaceRepo()) { ContentBucketSpace& bucket_space = *elem.second; auto derived_cluster_state = bucket_space.getClusterState(); - return derived_cluster_state->getNodeState(node).getState().oneOf("m"); - }); + if (!derived_cluster_state->getNodeState(node).getState().oneOf("m")) { + return false; + } + }; + return true; } bool diff --git a/vdslib/src/vespa/vdslib/container/documentsummary.h b/vdslib/src/vespa/vdslib/container/documentsummary.h index 2c23e51319b..bbfeb684559 100644 --- a/vdslib/src/vespa/vdslib/container/documentsummary.h +++ b/vdslib/src/vespa/vdslib/container/documentsummary.h @@ -35,7 +35,7 @@ public: private: class Summary { public: - Summary() : _docIdOffset(0), _summaryOffset(0), _summaryLen(0) { } + Summary() noexcept : _docIdOffset(0), _summaryOffset(0), _summaryLen(0) { } Summary(uint32_t docIdOffset, uint32_t summaryOffset, uint32_t summaryLen) : _docIdOffset(docIdOffset), _summaryOffset(summaryOffset), _summaryLen(summaryLen) { } const char * getDocId(const char * base) const { return base + _docIdOffset; } const void * getSummary(const char * base, size_t & sz) const { sz = _summaryLen; return base + _summaryOffset; } diff --git a/vdslib/src/vespa/vdslib/container/searchresult.h b/vdslib/src/vespa/vdslib/container/searchresult.h index 6b6e0aaae12..a777a4731e6 100644 --- a/vdslib/src/vespa/vdslib/container/searchresult.h +++ b/vdslib/src/vespa/vdslib/container/searchresult.h @@ -82,7 +82,7 @@ public: private: class Hit { public: - Hit() : _lid(0), _rank(0), _docIdOffset(0), _index(0) { } + Hit() noexcept : _lid(0), _rank(0), _docIdOffset(0), _index(0) { } Hit(uint32_t lid, RankType rank, size_t docIdOffset, size_t index) : _lid(lid), _rank(rank), _docIdOffset(docIdOffset), _index(index) { } const char * getDocId(const char * base) const { return base + getDocIdOffset(); } uint32_t getLid() const { return _lid; } diff --git a/vdslib/src/vespa/vdslib/distribution/redundancygroupdistribution.h b/vdslib/src/vespa/vdslib/distribution/redundancygroupdistribution.h index c7b1a3a05f7..dad7933ed2c 100644 --- a/vdslib/src/vespa/vdslib/distribution/redundancygroupdistribution.h +++ b/vdslib/src/vespa/vdslib/distribution/redundancygroupdistribution.h @@ -17,7 +17,7 @@ class RedundancyGroupDistribution : public document::Printable { std::vector<uint16_t> _values; public: - RedundancyGroupDistribution() {} + RedundancyGroupDistribution() noexcept {} /** * Create a group distribution spec from the serialized version. * Asterisk entries are represented as zero. diff --git a/vespabase/src/common-env.sh b/vespabase/src/common-env.sh index cd8c7c604ad..f75ffdbd13f 100755 --- a/vespabase/src/common-env.sh +++ b/vespabase/src/common-env.sh @@ -295,6 +295,10 @@ log_warning_message () { get_numa_ctl_cmd () { if ! type numactl &> /dev/null; then + if test "$(uname -s)" = Darwin + then + return 0 + fi echo "FATAL: Could not find required program numactl." exit 1 fi diff --git a/vespalib/src/tests/dotproduct/dotproductbenchmark.cpp b/vespalib/src/tests/dotproduct/dotproductbenchmark.cpp index 77bdbf6f58b..51380028ffa 100644 --- a/vespalib/src/tests/dotproduct/dotproductbenchmark.cpp +++ b/vespalib/src/tests/dotproduct/dotproductbenchmark.cpp @@ -83,7 +83,7 @@ public: ~SparseBenchmark(); protected: struct P { - P(uint32_t key=0, int32_t value=0) : + P(uint32_t key=0, int32_t value=0) noexcept : _key(key), _value(value) { } diff --git a/vespalib/src/tests/hwaccelrated/hwaccelrated_bench.cpp b/vespalib/src/tests/hwaccelrated/hwaccelrated_bench.cpp index 9984cfca440..4b0141596e7 100644 --- a/vespalib/src/tests/hwaccelrated/hwaccelrated_bench.cpp +++ b/vespalib/src/tests/hwaccelrated/hwaccelrated_bench.cpp @@ -3,7 +3,8 @@ #include <vespa/vespalib/hwaccelrated/iaccelrated.h> #include <vespa/vespalib/hwaccelrated/generic.h> #include <vespa/vespalib/util/time.h> -# +#include <cinttypes> + using namespace vespalib; template<typename T> @@ -28,7 +29,7 @@ benchmarkEuclideanDistance(const hwaccelrated::IAccelrated & accel, size_t sz, s sumOfSums += sum; } duration elapsed = steady_clock::now() - start; - printf("sum=%f of N=%zu and vector length=%zu took %ld\n", sumOfSums, count, sz, count_ms(elapsed)); + printf("sum=%f of N=%zu and vector length=%zu took %" PRId64 "\n", sumOfSums, count, sz, count_ms(elapsed)); } void diff --git a/vespalib/src/tests/invokeservice/invokeservice_test.cpp b/vespalib/src/tests/invokeservice/invokeservice_test.cpp index 22063281950..1d4791f4a33 100644 --- a/vespalib/src/tests/invokeservice/invokeservice_test.cpp +++ b/vespalib/src/tests/invokeservice/invokeservice_test.cpp @@ -1,6 +1,7 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/vespalib/util/invokeserviceimpl.h> +#include <atomic> using namespace vespalib; diff --git a/vespalib/src/tests/simple_thread_bundle/simple_thread_bundle_test.cpp b/vespalib/src/tests/simple_thread_bundle/simple_thread_bundle_test.cpp index b808635a8cc..8d5d393fe22 100644 --- a/vespalib/src/tests/simple_thread_bundle/simple_thread_bundle_test.cpp +++ b/vespalib/src/tests/simple_thread_bundle/simple_thread_bundle_test.cpp @@ -10,7 +10,7 @@ using namespace vespalib::fixed_thread_bundle; struct Cnt : Runnable { size_t x; - Cnt() : x(0) {} + Cnt() noexcept : x(0) {} void run() override { ++x; } }; diff --git a/vespalib/src/tests/simple_thread_bundle/threading_speed_test.cpp b/vespalib/src/tests/simple_thread_bundle/threading_speed_test.cpp index 13b0d003909..eb82425c819 100644 --- a/vespalib/src/tests/simple_thread_bundle/threading_speed_test.cpp +++ b/vespalib/src/tests/simple_thread_bundle/threading_speed_test.cpp @@ -19,7 +19,7 @@ struct Worker : Runnable { size_t iter; uint64_t input; uint64_t output; - Worker() : iter(1), input(0), output(0) {} + Worker() noexcept : iter(1), input(0), output(0) {} void init(size_t n, uint64_t i) { iter = n; input = i; diff --git a/vespalib/src/tests/wakeup/wakeup_bench.cpp b/vespalib/src/tests/wakeup/wakeup_bench.cpp index 3661a7c9389..1d9817508d3 100644 --- a/vespalib/src/tests/wakeup/wakeup_bench.cpp +++ b/vespalib/src/tests/wakeup/wakeup_bench.cpp @@ -184,8 +184,10 @@ template <typename T> auto create_list() { return list; } -void destroy_list(auto &list) __attribute__((noinline)); -void destroy_list(auto &list) { +template <typename T> +void destroy_list(T &list) __attribute__((noinline)); +template <typename T> +void destroy_list(T &list) { for (auto *item: list) { item->stop(); item->thread.join(); @@ -193,8 +195,10 @@ void destroy_list(auto &list) { } } -void wait_until_ready(const auto &list) __attribute__((noinline)); -void wait_until_ready(const auto &list) { +template <typename T> +void wait_until_ready(const T &list) __attribute__((noinline)); +template <typename T> +void wait_until_ready(const T &list) { size_t num_ready = 0; do { num_ready = 0; @@ -206,8 +210,10 @@ void wait_until_ready(const auto &list) { } while (num_ready < N); } -auto perform_wakeups(auto &list, size_t target) __attribute__((noinline)); -auto perform_wakeups(auto &list, size_t target) { +template <typename T> +auto perform_wakeups(T &list, size_t target) __attribute__((noinline)); +template <typename T> +auto perform_wakeups(T &list, size_t target) { size_t wake_cnt = 0; size_t skip_cnt = 0; while (wake_cnt < target) { diff --git a/vespalog/src/logger/runserver.cpp b/vespalog/src/logger/runserver.cpp index 68950cef4b2..f9dde87ca14 100644 --- a/vespalog/src/logger/runserver.cpp +++ b/vespalog/src/logger/runserver.cpp @@ -5,6 +5,7 @@ #include <fcntl.h> #include <cerrno> #include <unistd.h> +#include <csignal> #include <sys/select.h> #include <sys/types.h> diff --git a/vespalog/src/vespa/log/control-file.h b/vespalog/src/vespa/log/control-file.h index 69e725dc465..31c15077c8c 100644 --- a/vespalog/src/vespa/log/control-file.h +++ b/vespalog/src/vespa/log/control-file.h @@ -2,8 +2,8 @@ #pragma once #include "log.h" -#include "control-file.h" #include "lock.h" +#include <string> namespace ns_log { |