mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 22:51:20 +02:00
Add shutdown annotations for crash reporting
This commit is contained in:
parent
95b219475d
commit
a4c857315a
6 changed files with 65 additions and 2 deletions
|
@ -22,6 +22,7 @@
|
||||||
#include <AccountManager.h>
|
#include <AccountManager.h>
|
||||||
#include <AddressManager.h>
|
#include <AddressManager.h>
|
||||||
#include <Assignment.h>
|
#include <Assignment.h>
|
||||||
|
#include <CrashAnnotations.h>
|
||||||
#include <LogHandler.h>
|
#include <LogHandler.h>
|
||||||
#include <LogUtils.h>
|
#include <LogUtils.h>
|
||||||
#include <LimitedNodeList.h>
|
#include <LimitedNodeList.h>
|
||||||
|
@ -144,6 +145,7 @@ AssignmentClient::~AssignmentClient() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssignmentClient::aboutToQuit() {
|
void AssignmentClient::aboutToQuit() {
|
||||||
|
crash::annotations::setShutdownState(true);
|
||||||
stopAssignmentClient();
|
stopAssignmentClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,6 +175,7 @@ void AssignmentClient::sendStatusPacketToACM() {
|
||||||
|
|
||||||
void AssignmentClient::sendAssignmentRequest() {
|
void AssignmentClient::sendAssignmentRequest() {
|
||||||
if (!_currentAssignment && !_isAssigned) {
|
if (!_currentAssignment && !_isAssigned) {
|
||||||
|
crash::annotations::setShutdownState(false);
|
||||||
|
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
|
|
||||||
|
@ -289,6 +292,8 @@ void AssignmentClient::handleAuthenticationRequest() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssignmentClient::assignmentCompleted() {
|
void AssignmentClient::assignmentCompleted() {
|
||||||
|
crash::annotations::setShutdownState(true);
|
||||||
|
|
||||||
// we expect that to be here the previous assignment has completely cleaned up
|
// we expect that to be here the previous assignment has completely cleaned up
|
||||||
assert(_currentAssignment.isNull());
|
assert(_currentAssignment.isNull());
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include <AccountManager.h>
|
#include <AccountManager.h>
|
||||||
#include <AssetClient.h>
|
#include <AssetClient.h>
|
||||||
#include <BuildInfo.h>
|
#include <BuildInfo.h>
|
||||||
|
#include <CrashAnnotations.h>
|
||||||
#include <DependencyManager.h>
|
#include <DependencyManager.h>
|
||||||
#include <HifiConfigVariantMap.h>
|
#include <HifiConfigVariantMap.h>
|
||||||
#include <HTTPConnection.h>
|
#include <HTTPConnection.h>
|
||||||
|
@ -432,6 +433,10 @@ DomainServer::~DomainServer() {
|
||||||
DependencyManager::destroy<LimitedNodeList>();
|
DependencyManager::destroy<LimitedNodeList>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DomainServer::aboutToQuit() {
|
||||||
|
crash::annotations::setShutdownState(true);
|
||||||
|
}
|
||||||
|
|
||||||
void DomainServer::queuedQuit(QString quitMessage, int exitCode) {
|
void DomainServer::queuedQuit(QString quitMessage, int exitCode) {
|
||||||
if (!quitMessage.isEmpty()) {
|
if (!quitMessage.isEmpty()) {
|
||||||
qWarning() << qPrintable(quitMessage);
|
qWarning() << qPrintable(quitMessage);
|
||||||
|
|
|
@ -136,6 +136,8 @@ private slots:
|
||||||
void tokenGrantFinished();
|
void tokenGrantFinished();
|
||||||
void profileRequestFinished();
|
void profileRequestFinished();
|
||||||
|
|
||||||
|
void aboutToQuit();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void iceServerChanged();
|
void iceServerChanged();
|
||||||
void userConnected();
|
void userConnected();
|
||||||
|
|
|
@ -15,9 +15,10 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <BuildInfo.h>
|
||||||
|
#include <CrashAnnotations.h>
|
||||||
#include <LogHandler.h>
|
#include <LogHandler.h>
|
||||||
#include <SharedUtil.h>
|
#include <SharedUtil.h>
|
||||||
#include <BuildInfo.h>
|
|
||||||
|
|
||||||
#include "DomainServer.h"
|
#include "DomainServer.h"
|
||||||
|
|
||||||
|
@ -32,6 +33,7 @@ int main(int argc, char* argv[]) {
|
||||||
|
|
||||||
// use a do-while to handle domain-server restart
|
// use a do-while to handle domain-server restart
|
||||||
do {
|
do {
|
||||||
|
crash::annotations::setShutdownState(false);
|
||||||
DomainServer domainServer(argc, argv);
|
DomainServer domainServer(argc, argv);
|
||||||
currentExitCode = domainServer.exec();
|
currentExitCode = domainServer.exec();
|
||||||
} while (currentExitCode == DomainServer::EXIT_CODE_REBOOT);
|
} while (currentExitCode == DomainServer::EXIT_CODE_REBOOT);
|
||||||
|
@ -39,4 +41,3 @@ int main(int argc, char* argv[]) {
|
||||||
qInfo() << "Quitting.";
|
qInfo() << "Quitting.";
|
||||||
return currentExitCode;
|
return currentExitCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
27
libraries/shared/src/CrashAnnotations.cpp
Normal file
27
libraries/shared/src/CrashAnnotations.cpp
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
//
|
||||||
|
// CrashAnnotations.cpp
|
||||||
|
// libraries/shared/src
|
||||||
|
//
|
||||||
|
// Created by Clement Brisset on 9/26/19.
|
||||||
|
// Copyright 2019 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "SharedUtil.h"
|
||||||
|
|
||||||
|
// Global variables specifically tuned to work with ptrace module for crash collection
|
||||||
|
// Do not move/rename unless you update the ptrace module with it.
|
||||||
|
bool crash_annotation_isShuttingDown = false;
|
||||||
|
|
||||||
|
namespace crash {
|
||||||
|
namespace annotations {
|
||||||
|
|
||||||
|
void setShutdownState(bool isShuttingDown) {
|
||||||
|
crash_annotation_isShuttingDown = isShuttingDown;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
23
libraries/shared/src/CrashAnnotations.h
Normal file
23
libraries/shared/src/CrashAnnotations.h
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
//
|
||||||
|
// CrashAnnotations.h
|
||||||
|
// libraries/shared/src
|
||||||
|
//
|
||||||
|
// Created by Clement Brisset on 9/26/19.
|
||||||
|
// Copyright 2019 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef hifi_CrashAnnotations_h
|
||||||
|
#define hifi_CrashAnnotations_h
|
||||||
|
|
||||||
|
namespace crash {
|
||||||
|
namespace annotations {
|
||||||
|
|
||||||
|
void setShutdownState(bool isShuttingDown);
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // hifi_CrashAnnotations_h
|
Loading…
Reference in a new issue