History

Add --disableWatchdog command-line option

Watchdog still runs but doesn't abort on timeout. Also fixes for previous tracing improvements.

Simon Walton committed 8 years ago

Commit 5c141aa1 parent 888fca22 files · +12 −5Browse files

Showing the changes to interface/src/Application.cpp (1 of 2 files). Show all

Unified · Split

interface/src/Application.cpp+10−3
@@ -399,7 +399,8 @@ public: · 398 unmodified lines
399399 static const int HEARTBEAT_SAMPLES = 100000; // ~5 seconds worth of samples
400400
401401 // Set the heartbeat on launch
402− DeadlockWatchdogThread() {
402+ DeadlockWatchdogThread(bool crashOnTrigger = true)
403+ : _crashOnTrigger(crashOnTrigger) {
403404 setObjectName("Deadlock Watchdog");
404405 // Give the heartbeat an initial value
405406 _heartbeat = usecTimestampNow();
@@ -490,7 +491,9 @@ public: · 84 unmodified lines
490491 // Don't actually crash in debug builds, in case this apparent deadlock is simply from
491492 // the developer actively debugging code
492493 #ifdef NDEBUG
494+ if (_crashOnTrigger) {
493495 deadlockDetectionCrash();
496+ }
494497 #endif
495498 }
496499 }
@@ -502,6 +505,8 @@ public: · 5 unmodified lines
502505 static std::atomic<int> _maxElapsedAverage;
503506 static ThreadSafeMovingAverage<int, HEARTBEAT_SAMPLES> _movingAverage;
504507
508+ const bool _crashOnTrigger;
509+
505510 bool _quit { false };
506511 };
507512
@@ -957,7 +962,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 449 unmodified lines
957962 auto steamClient = PluginManager::getInstance()->getSteamClientPlugin();
958963 setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning()));
959964 setProperty(hifi::properties::CRASHED, _previousSessionCrashed);
960−
965+ bool watchdogCrashWhenTriggered = true;
961966 {
962967 const QString TEST_SCRIPT = "--testScript";
963968 const QStringList args = arguments();
@@ -967,6 +972,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 3 unmodified lines
967972 if (QFileInfo(testScriptPath).exists()) {
968973 setProperty(hifi::properties::TEST, QUrl::fromLocalFile(testScriptPath));
969974 }
975+ } else if (args.at(i) == QStringLiteral("--disableWatchdog")) {
976+ watchdogCrashWhenTriggered = false;
970977 }
971978 }
972979 }
@@ -1014,7 +1021,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 41 unmodified lines
10141021
10151022 // Set up a watchdog thread to intentionally crash the application on deadlocks
10161023 if (!DISABLE_WATCHDOG) {
1017− (new DeadlockWatchdogThread())->start();
1024+ (new DeadlockWatchdogThread(watchdogCrashWhenTriggered))->start();
10181025 }
10191026
10201027 // Set File Logger Session UUID

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t