From 182bb8378910a9540ad2ff70de01ed0626216d4f Mon Sep 17 00:00:00 2001 From: Richard Chapman Date: Wed, 13 Dec 2023 12:11:05 +0000 Subject: [PATCH] HPCC-31011 toposerver timeouts should check for sensible values Signed-off-by: Richard Chapman --- roxie/topo/toposerver.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/roxie/topo/toposerver.cpp b/roxie/topo/toposerver.cpp index 01bd6975198..c5c184284b9 100644 --- a/roxie/topo/toposerver.cpp +++ b/roxie/topo/toposerver.cpp @@ -368,9 +368,9 @@ int main(int argc, const char *argv[]) timeoutCheckInterval = topology->getPropInt("@timeoutCheckInterval", timeoutCheckInterval); heartbeatInterval = topology->getPropInt("@heartbeatInterval", heartbeatInterval); - timeoutHeartbeatAgent = topology->getPropInt("@timeoutHeartbeatAgent", timeoutHeartbeatAgent); - timeoutHeartbeatServer = topology->getPropInt("@timeoutHeartbeatServer", timeoutHeartbeatServer); - removeHeartbeatInterval = topology->getPropInt("@removeHeartbeatInterval", removeHeartbeatInterval); + timeoutHeartbeatAgent = topology->getPropInt("@timeoutHeartbeatAgent", heartbeatInterval*2); + timeoutHeartbeatServer = topology->getPropInt("@timeoutHeartbeatServer", heartbeatInterval*6); + removeHeartbeatInterval = topology->getPropInt("@removeHeartbeatInterval", heartbeatInterval*10); topologyReportInterval = topology->getPropInt("@topologyReportInterval", topologyReportInterval); #ifndef _CONTAINERIZED @@ -390,6 +390,21 @@ int main(int argc, const char *argv[]) #else setupContainerizedLogMsgHandler(); #endif + if (timeoutHeartbeatAgent < (heartbeatInterval*4)/3) + { + timeoutHeartbeatAgent = heartbeatInterval*2; + DBGLOG("timeoutHeartbeatAgent value too small - setting to %u", timeoutHeartbeatAgent); + } + if (timeoutHeartbeatServer < (heartbeatInterval*2)) + { + timeoutHeartbeatServer = heartbeatInterval*6; + DBGLOG("timeoutHeartbeatServer value too small - setting to %u", timeoutHeartbeatServer); + } + if (removeHeartbeatInterval < timeoutHeartbeatServer) + { + removeHeartbeatInterval = timeoutHeartbeatServer*2; + DBGLOG("removeHeartbeatInterval value too small - setting to %u", removeHeartbeatInterval); + } Owned socket = ISocket::create(topoPort); if (traceLevel) DBGLOG("Topology server starting on port %u", topoPort);