mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 19:21:16 +02:00
Merge pull request #12484 from ZappoMan/relaxDeadlockWatchdog
Relax deadlock watchdog
This commit is contained in:
commit
3d54f4d246
4 changed files with 20 additions and 1 deletions
|
@ -392,7 +392,7 @@ const QHash<QString, Application::AcceptURLMethod> Application::_acceptedExtensi
|
||||||
class DeadlockWatchdogThread : public QThread {
|
class DeadlockWatchdogThread : public QThread {
|
||||||
public:
|
public:
|
||||||
static const unsigned long HEARTBEAT_UPDATE_INTERVAL_SECS = 1;
|
static const unsigned long HEARTBEAT_UPDATE_INTERVAL_SECS = 1;
|
||||||
static const unsigned long MAX_HEARTBEAT_AGE_USECS = 30 * USECS_PER_SECOND;
|
static const unsigned long MAX_HEARTBEAT_AGE_USECS = 120 * USECS_PER_SECOND; // 2 mins with no checkin probably a deadlock
|
||||||
static const int WARNING_ELAPSED_HEARTBEAT = 500 * USECS_PER_MSEC; // warn if elapsed heartbeat average is large
|
static const int WARNING_ELAPSED_HEARTBEAT = 500 * USECS_PER_MSEC; // warn if elapsed heartbeat average is large
|
||||||
static const int HEARTBEAT_SAMPLES = 100000; // ~5 seconds worth of samples
|
static const int HEARTBEAT_SAMPLES = 100000; // ~5 seconds worth of samples
|
||||||
|
|
||||||
|
@ -1719,6 +1719,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
properties["has_async_reprojection"] = displayPlugin->hasAsyncReprojection();
|
properties["has_async_reprojection"] = displayPlugin->hasAsyncReprojection();
|
||||||
properties["hardware_stats"] = displayPlugin->getHardwareStats();
|
properties["hardware_stats"] = displayPlugin->getHardwareStats();
|
||||||
|
|
||||||
|
// deadlock watchdog related stats
|
||||||
|
properties["deadlock_watchdog_maxElapsed"] = (int)DeadlockWatchdogThread::_maxElapsed;
|
||||||
|
properties["deadlock_watchdog_maxElapsedAverage"] = (int)DeadlockWatchdogThread::_maxElapsedAverage;
|
||||||
|
|
||||||
auto bandwidthRecorder = DependencyManager::get<BandwidthRecorder>();
|
auto bandwidthRecorder = DependencyManager::get<BandwidthRecorder>();
|
||||||
properties["packet_rate_in"] = bandwidthRecorder->getCachedTotalAverageInputPacketsPerSecond();
|
properties["packet_rate_in"] = bandwidthRecorder->getCachedTotalAverageInputPacketsPerSecond();
|
||||||
properties["packet_rate_out"] = bandwidthRecorder->getCachedTotalAverageOutputPacketsPerSecond();
|
properties["packet_rate_out"] = bandwidthRecorder->getCachedTotalAverageOutputPacketsPerSecond();
|
||||||
|
@ -7542,6 +7546,18 @@ void Application::deadlockApplication() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// cause main thread to be unresponsive for 35 seconds
|
||||||
|
void Application::unresponsiveApplication() {
|
||||||
|
// to avoid compiler warnings about a loop that will never exit
|
||||||
|
uint64_t start = usecTimestampNow();
|
||||||
|
uint64_t UNRESPONSIVE_FOR_SECONDS = 35;
|
||||||
|
uint64_t UNRESPONSIVE_FOR_USECS = UNRESPONSIVE_FOR_SECONDS * USECS_PER_SECOND;
|
||||||
|
qCDebug(interfaceapp) << "Intentionally cause Interface to be unresponsive for " << UNRESPONSIVE_FOR_SECONDS << " seconds";
|
||||||
|
while (usecTimestampNow() - start < UNRESPONSIVE_FOR_USECS) {
|
||||||
|
QThread::sleep(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Application::setActiveDisplayPlugin(const QString& pluginName) {
|
void Application::setActiveDisplayPlugin(const QString& pluginName) {
|
||||||
auto menu = Menu::getInstance();
|
auto menu = Menu::getInstance();
|
||||||
foreach(DisplayPluginPointer displayPlugin, PluginManager::getInstance()->getDisplayPlugins()) {
|
foreach(DisplayPluginPointer displayPlugin, PluginManager::getInstance()->getDisplayPlugins()) {
|
||||||
|
|
|
@ -369,6 +369,7 @@ public slots:
|
||||||
void updateHeartbeat() const;
|
void updateHeartbeat() const;
|
||||||
|
|
||||||
static void deadlockApplication();
|
static void deadlockApplication();
|
||||||
|
static void unresponsiveApplication(); // cause main thread to be unresponsive for 35 seconds
|
||||||
|
|
||||||
void rotationModeChanged() const;
|
void rotationModeChanged() const;
|
||||||
|
|
||||||
|
|
|
@ -713,6 +713,7 @@ Menu::Menu() {
|
||||||
MenuWrapper* crashMenu = developerMenu->addMenu("Crash");
|
MenuWrapper* crashMenu = developerMenu->addMenu("Crash");
|
||||||
|
|
||||||
addActionToQMenuAndActionHash(crashMenu, MenuOption::DeadlockInterface, 0, qApp, SLOT(deadlockApplication()));
|
addActionToQMenuAndActionHash(crashMenu, MenuOption::DeadlockInterface, 0, qApp, SLOT(deadlockApplication()));
|
||||||
|
addActionToQMenuAndActionHash(crashMenu, MenuOption::UnresponsiveInterface, 0, qApp, SLOT(unresponsiveApplication()));
|
||||||
|
|
||||||
action = addActionToQMenuAndActionHash(crashMenu, MenuOption::CrashPureVirtualFunction);
|
action = addActionToQMenuAndActionHash(crashMenu, MenuOption::CrashPureVirtualFunction);
|
||||||
connect(action, &QAction::triggered, qApp, []() { crash::pureVirtualCall(); });
|
connect(action, &QAction::triggered, qApp, []() { crash::pureVirtualCall(); });
|
||||||
|
|
|
@ -77,6 +77,7 @@ namespace MenuOption {
|
||||||
const QString CrashNewFault = "New Fault";
|
const QString CrashNewFault = "New Fault";
|
||||||
const QString CrashNewFaultThreaded = "New Fault (threaded)";
|
const QString CrashNewFaultThreaded = "New Fault (threaded)";
|
||||||
const QString DeadlockInterface = "Deadlock Interface";
|
const QString DeadlockInterface = "Deadlock Interface";
|
||||||
|
const QString UnresponsiveInterface = "Unresponsive Interface";
|
||||||
const QString DecreaseAvatarSize = "Decrease Avatar Size";
|
const QString DecreaseAvatarSize = "Decrease Avatar Size";
|
||||||
const QString DefaultSkybox = "Default Skybox";
|
const QString DefaultSkybox = "Default Skybox";
|
||||||
const QString DeleteAvatarBookmark = "Delete Avatar Bookmark...";
|
const QString DeleteAvatarBookmark = "Delete Avatar Bookmark...";
|
||||||
|
|
Loading…
Reference in a new issue