mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 13:09:52 +02:00
Add --disableWatchdog command-line option
Watchdog still runs but doesn't abort on timeout. Also fixes for previous tracing improvements.
This commit is contained in:
parent
888fca2127
commit
5c141aa5e9
2 changed files with 12 additions and 5 deletions
|
@ -399,7 +399,8 @@ public:
|
||||||
static const int HEARTBEAT_SAMPLES = 100000; // ~5 seconds worth of samples
|
static const int HEARTBEAT_SAMPLES = 100000; // ~5 seconds worth of samples
|
||||||
|
|
||||||
// Set the heartbeat on launch
|
// Set the heartbeat on launch
|
||||||
DeadlockWatchdogThread() {
|
DeadlockWatchdogThread(bool crashOnTrigger = true)
|
||||||
|
: _crashOnTrigger(crashOnTrigger) {
|
||||||
setObjectName("Deadlock Watchdog");
|
setObjectName("Deadlock Watchdog");
|
||||||
// Give the heartbeat an initial value
|
// Give the heartbeat an initial value
|
||||||
_heartbeat = usecTimestampNow();
|
_heartbeat = usecTimestampNow();
|
||||||
|
@ -490,7 +491,9 @@ public:
|
||||||
// Don't actually crash in debug builds, in case this apparent deadlock is simply from
|
// Don't actually crash in debug builds, in case this apparent deadlock is simply from
|
||||||
// the developer actively debugging code
|
// the developer actively debugging code
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
|
if (_crashOnTrigger) {
|
||||||
deadlockDetectionCrash();
|
deadlockDetectionCrash();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -502,6 +505,8 @@ public:
|
||||||
static std::atomic<int> _maxElapsedAverage;
|
static std::atomic<int> _maxElapsedAverage;
|
||||||
static ThreadSafeMovingAverage<int, HEARTBEAT_SAMPLES> _movingAverage;
|
static ThreadSafeMovingAverage<int, HEARTBEAT_SAMPLES> _movingAverage;
|
||||||
|
|
||||||
|
const bool _crashOnTrigger;
|
||||||
|
|
||||||
bool _quit { false };
|
bool _quit { false };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -957,7 +962,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
auto steamClient = PluginManager::getInstance()->getSteamClientPlugin();
|
auto steamClient = PluginManager::getInstance()->getSteamClientPlugin();
|
||||||
setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning()));
|
setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning()));
|
||||||
setProperty(hifi::properties::CRASHED, _previousSessionCrashed);
|
setProperty(hifi::properties::CRASHED, _previousSessionCrashed);
|
||||||
|
bool watchdogCrashWhenTriggered = true;
|
||||||
{
|
{
|
||||||
const QString TEST_SCRIPT = "--testScript";
|
const QString TEST_SCRIPT = "--testScript";
|
||||||
const QStringList args = arguments();
|
const QStringList args = arguments();
|
||||||
|
@ -967,6 +972,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
if (QFileInfo(testScriptPath).exists()) {
|
if (QFileInfo(testScriptPath).exists()) {
|
||||||
setProperty(hifi::properties::TEST, QUrl::fromLocalFile(testScriptPath));
|
setProperty(hifi::properties::TEST, QUrl::fromLocalFile(testScriptPath));
|
||||||
}
|
}
|
||||||
|
} else if (args.at(i) == QStringLiteral("--disableWatchdog")) {
|
||||||
|
watchdogCrashWhenTriggered = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1014,7 +1021,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
|
|
||||||
// Set up a watchdog thread to intentionally crash the application on deadlocks
|
// Set up a watchdog thread to intentionally crash the application on deadlocks
|
||||||
if (!DISABLE_WATCHDOG) {
|
if (!DISABLE_WATCHDOG) {
|
||||||
(new DeadlockWatchdogThread())->start();
|
(new DeadlockWatchdogThread(watchdogCrashWhenTriggered))->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set File Logger Session UUID
|
// Set File Logger Session UUID
|
||||||
|
|
|
@ -73,7 +73,7 @@ class JobConcept {
|
||||||
public:
|
public:
|
||||||
using Config = JobConfig;
|
using Config = JobConfig;
|
||||||
|
|
||||||
JobConcept(const std::string& name, QConfigPointer config) : _name(name), _config(config) {}
|
JobConcept(const std::string& name, QConfigPointer config) : _config(config), _name(name) {}
|
||||||
virtual ~JobConcept() = default;
|
virtual ~JobConcept() = default;
|
||||||
|
|
||||||
const std::string& getName() const { return _name; }
|
const std::string& getName() const { return _name; }
|
||||||
|
@ -330,7 +330,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void applyConfiguration() override {
|
void applyConfiguration() override {
|
||||||
Duration profileRange(trace_render(), ("configure::" + JobConcept::getName()).c_str());
|
Duration profileRange(trace_render(), ("configure::" + JobConcept::getName()).c_str());
|
||||||
jobConfigure(_data, *std::static_pointer_cast<C>(Concept::_config));
|
jobConfigure(_data, *std::static_pointer_cast<C>(Concept::_config));
|
||||||
for (auto& job : TaskConcept::_jobs) {
|
for (auto& job : TaskConcept::_jobs) {
|
||||||
job.applyConfiguration();
|
job.applyConfiguration();
|
||||||
|
|
Loading…
Reference in a new issue