Skip to content

Commit

Permalink
HPCC-31011 toposerver timeouts should check for sensible values
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Chapman <[email protected]>
  • Loading branch information
richardkchapman committed Jan 3, 2024
1 parent 25fd4c4 commit 182bb83
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions roxie/topo/toposerver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<ISocket> socket = ISocket::create(topoPort);
if (traceLevel)
DBGLOG("Topology server starting on port %u", topoPort);
Expand Down

0 comments on commit 182bb83

Please sign in to comment.