aboutsummaryrefslogtreecommitdiffstats
path: root/configd
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2021-06-07 21:07:23 +0000
committerArne Juul <arnej@verizonmedia.com>2021-06-07 21:07:23 +0000
commita402fb4fab902b9f8c9a8859b1142e436bf439e3 (patch)
tree2c5da064bd01a452b1b71f74536d515fba667918 /configd
parentf16f846f7486febb25069284278034ce597dc164 (diff)
minor fixups after review
Diffstat (limited to 'configd')
-rw-r--r--configd/src/apps/sentinel/connectivity.cpp6
-rw-r--r--configd/src/apps/sentinel/env.cpp1
2 files changed, 4 insertions, 3 deletions
diff --git a/configd/src/apps/sentinel/connectivity.cpp b/configd/src/apps/sentinel/connectivity.cpp
index 74f11f086d6..132b57fc884 100644
--- a/configd/src/apps/sentinel/connectivity.cpp
+++ b/configd/src/apps/sentinel/connectivity.cpp
@@ -24,7 +24,7 @@ Connectivity::~Connectivity() = default;
namespace {
-const char *toString(CcResult value) {
+std::string toString(CcResult value) {
switch (value) {
case CcResult::UNKNOWN: return "BAD: missing result"; // very very bad
case CcResult::REVERSE_FAIL: return "connect OK, but reverse check FAILED"; // very bad
@@ -90,10 +90,10 @@ Connectivity::checkConnectivity(RpcServer &rpcServer) {
size_t numFailedReverse = 0;
bool allChecksOk = true;
for (const auto & [hostname, check] : connectivityMap) {
- const char *detail = toString(check.result());
+ std::string detail = toString(check.result());
std::string prev = _detailsPerHost[hostname];
if (prev != detail) {
- LOG(info, "Connectivity check details: %s -> %s", hostname.c_str(), detail);
+ LOG(info, "Connectivity check details: %s -> %s", hostname.c_str(), detail.c_str());
}
_detailsPerHost[hostname] = detail;
LOG_ASSERT(check.result() != CcResult::UNKNOWN);
diff --git a/configd/src/apps/sentinel/env.cpp b/configd/src/apps/sentinel/env.cpp
index 9763956bada..5bbbfd8f0bd 100644
--- a/configd/src/apps/sentinel/env.cpp
+++ b/configd/src/apps/sentinel/env.cpp
@@ -56,6 +56,7 @@ void Env::boot(const std::string &configId) {
Connectivity checker;
for (int retry = 0; retry < maxConnectivityRetries; ++retry) {
bool changed = _cfgOwner.checkForConfigUpdate();
+ LOG_ASSERT(changed || retry > 0);
if (changed) {
LOG_ASSERT(_cfgOwner.hasConfig());
const auto & cfg = _cfgOwner.getConfig();