diff options
author | Arne Juul <arnej@verizonmedia.com> | 2021-08-26 11:06:30 +0000 |
---|---|---|
committer | Arne Juul <arnej@verizonmedia.com> | 2021-08-26 11:06:30 +0000 |
commit | ae82748e8ca5ea2136be4a193fe0a3855f1abbc1 (patch) | |
tree | c0ab0e4757a43e82cf3257c3a8b8273eae875cf5 /configd | |
parent | c99600b4b9e427d5f8081f05c27879f6e5aab87a (diff) |
allow 20ms for each TLS handshake to perform
Diffstat (limited to 'configd')
-rw-r--r-- | configd/src/apps/sentinel/connectivity.cpp | 10 | ||||
-rw-r--r-- | configd/src/apps/sentinel/outward-check.cpp | 6 | ||||
-rw-r--r-- | configd/src/apps/sentinel/outward-check.h | 2 | ||||
-rw-r--r-- | configd/src/apps/sentinel/report-connectivity.cpp | 1 |
4 files changed, 12 insertions, 7 deletions
diff --git a/configd/src/apps/sentinel/connectivity.cpp b/configd/src/apps/sentinel/connectivity.cpp index 5996d709c5d..f6206d0d510 100644 --- a/configd/src/apps/sentinel/connectivity.cpp +++ b/configd/src/apps/sentinel/connectivity.cpp @@ -75,8 +75,10 @@ void classifyConnFails(ConnectivityMap &connectivityMap, LOG_ASSERT(cmIter != connectivityMap.end()); OutwardCheckContext cornerContext(goodNeighborSpecs.size(), nameToCheck, portToCheck, rpcServer.orb()); ConnectivityMap cornerProbes; + int ping_timeout = 1000; for (const auto & hp : goodNeighborSpecs) { - cornerProbes.try_emplace(hp.first, spec(hp), cornerContext); + cornerProbes.try_emplace(hp.first, spec(hp), cornerContext, ping_timeout); + ping_timeout += 20; } cornerContext.latch.await(); size_t numReportsUp = 0; @@ -92,7 +94,7 @@ void classifyConnFails(ConnectivityMap &connectivityMap, myHostname, rpcServer.getPort(), rpcServer.orb()); - OutwardCheck check(spec(toClassify), reverseContext); + OutwardCheck check(spec(toClassify), reverseContext, 1000); reverseContext.latch.await(); auto secondResult = check.result(); if (secondResult == CcResult::CONN_FAIL) { @@ -152,8 +154,10 @@ Connectivity::checkConnectivity(RpcServer &rpcServer) { rpcServer.getPort(), rpcServer.orb()); ConnectivityMap connectivityMap; + int ping_timeout = 1000; for (const auto &host_and_port : _checkSpecs) { - connectivityMap.try_emplace(host_and_port.first, spec(host_and_port), checkContext); + connectivityMap.try_emplace(host_and_port.first, spec(host_and_port), checkContext, ping_timeout); + ping_timeout += 20; } checkContext.latch.await(); classifyConnFails(connectivityMap, _checkSpecs, rpcServer); diff --git a/configd/src/apps/sentinel/outward-check.cpp b/configd/src/apps/sentinel/outward-check.cpp index 391e5fee8bf..f9a39cbec8a 100644 --- a/configd/src/apps/sentinel/outward-check.cpp +++ b/configd/src/apps/sentinel/outward-check.cpp @@ -9,7 +9,7 @@ namespace config::sentinel { OutwardCheckContext::~OutwardCheckContext() = default; -OutwardCheck::OutwardCheck(const std::string &spec, OutwardCheckContext &context) +OutwardCheck::OutwardCheck(const std::string &spec, OutwardCheckContext &context, int ping_timeout) : _spec(spec), _context(context) { @@ -18,8 +18,8 @@ OutwardCheck::OutwardCheck(const std::string &spec, OutwardCheckContext &context _req->SetMethodName("sentinel.check.connectivity"); _req->GetParams()->AddString(context.targetHostname.c_str()); _req->GetParams()->AddInt32(context.targetPortnum); - _req->GetParams()->AddInt32(500); - _target->InvokeAsync(_req, 1.500, this); + _req->GetParams()->AddInt32(ping_timeout); + _target->InvokeAsync(_req, 1.0 + ping_timeout*0.002, this); } OutwardCheck::~OutwardCheck() = default; diff --git a/configd/src/apps/sentinel/outward-check.h b/configd/src/apps/sentinel/outward-check.h index 0e53b9010dc..8e279da592f 100644 --- a/configd/src/apps/sentinel/outward-check.h +++ b/configd/src/apps/sentinel/outward-check.h @@ -38,7 +38,7 @@ private: std::string _spec; OutwardCheckContext &_context; public: - OutwardCheck(const std::string &spec, OutwardCheckContext &context); + OutwardCheck(const std::string &spec, OutwardCheckContext &context, int ping_timeout); virtual ~OutwardCheck(); void RequestDone(FRT_RPCRequest *req) override; bool ok() const { return _result == CcResult::ALL_OK; } diff --git a/configd/src/apps/sentinel/report-connectivity.cpp b/configd/src/apps/sentinel/report-connectivity.cpp index 1ea7365aa3f..270bed82965 100644 --- a/configd/src/apps/sentinel/report-connectivity.cpp +++ b/configd/src/apps/sentinel/report-connectivity.cpp @@ -24,6 +24,7 @@ ReportConnectivity::ReportConnectivity(FRT_RPCRequest *req, int timeout_ms, FRT_ _remaining = map.size(); for (const auto & [ hostname, port ] : map) { _checks.emplace_back(std::make_unique<PeerCheck>(*this, hostname, port, orb, timeout_ms)); + timeout_ms += 20; } } else { _parentRequest->SetError(FRTE_RPC_METHOD_FAILED, "failed getting model config"); |