mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Heartbeats need to happen while waiting for sandbox
We can only know if sandbox is up by waiting for the http request to succeed or fail. In the common case (fail since it isn't up yet), we have to wait until a connect timeout in http. Seems that is a couple seconds, and in that time we really upset the deadlock watchdog thread since it keeps a moving average of heartbeat times. Simple solution, updateHeartbeat while waiting, and right before we start.
This commit is contained in:
parent
ba9d9f6ab7
commit
aa31d3d8cc
1 changed files with 4 additions and 0 deletions
|
@ -585,6 +585,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
static bool determinedSandboxState = false;
|
||||
static bool sandboxIsRunning = false;
|
||||
SandboxUtils sandboxUtils;
|
||||
// updateHeartbeat() because we are going to poll shortly...
|
||||
updateHeartbeat();
|
||||
sandboxUtils.ifLocalSandboxRunningElse([&]() {
|
||||
qCDebug(interfaceapp) << "Home sandbox appears to be running.....";
|
||||
determinedSandboxState = true;
|
||||
|
@ -605,6 +607,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
auto startWaiting = usecTimestampNow();
|
||||
while (!determinedSandboxState && (usecTimestampNow() - startWaiting <= MAX_WAIT_TIME)) {
|
||||
QCoreApplication::processEvents();
|
||||
// updateHeartbeat() while polling so we don't scare the deadlock watchdog
|
||||
updateHeartbeat();
|
||||
usleep(USECS_PER_MSEC * 50); // 20hz
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue