summaryrefslogtreecommitdiffstats
path: root/configd/src/apps/sentinel/env.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'configd/src/apps/sentinel/env.cpp')
-rw-r--r--configd/src/apps/sentinel/env.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/configd/src/apps/sentinel/env.cpp b/configd/src/apps/sentinel/env.cpp
index 189be7a53b7..ded615a3c4a 100644
--- a/configd/src/apps/sentinel/env.cpp
+++ b/configd/src/apps/sentinel/env.cpp
@@ -114,30 +114,26 @@ void Env::respondAsEmpty() {
}
bool Env::waitForConnectivity(int outerRetry) {
- Connectivity::CheckResult lastCheckResult;
auto up = ConfigOwner::fetchModelConfig(MODEL_TIMEOUT_MS);
if (! up) {
LOG(warning, "could not get model config, skipping connectivity checks");
return true;
}
+ Connectivity::CheckResult lastCheckResult;
Connectivity checker(_cfgOwner.getConfig().connectivity, *_rpcServer);
for (int retry = 0; retry < maxRetriesInsideLoop; ++retry) {
auto res = checker.checkConnectivity(*up);
if (res.enoughOk) {
LOG(info, "Connectivity check OK, proceeding with service startup");
- if (! res.allOk) {
- for (const std::string &detail : res.details) {
- LOG(info, "Connectivity check details: %s", detail.c_str());
- }
+ if (retry > 0 || ! res.allOk) {
+ res.logDetails();
}
return true;
}
LOG(warning, "Connectivity check FAILED (try %d)", 1 + retry + maxRetriesInsideLoop*outerRetry);
_stateApi.myHealth.setFailed("FAILED connectivity check");
if (lastCheckResult.details != res.details) {
- for (const std::string &detail : res.details) {
- LOG(info, "Connectivity check details: %s", detail.c_str());
- }
+ res.logDetails();
lastCheckResult = std::move(res);
}
for (int i = 0; i <= outerRetry; ++i) {