mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01: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 <AddressManager.h>
|
||||
#include <Assignment.h>
|
||||
#include <CrashAnnotations.h>
|
||||
#include <LogHandler.h>
|
||||
#include <LogUtils.h>
|
||||
#include <LimitedNodeList.h>
|
||||
|
@ -144,6 +145,7 @@ AssignmentClient::~AssignmentClient() {
|
|||
}
|
||||
|
||||
void AssignmentClient::aboutToQuit() {
|
||||
crash::annotations::setShutdownState(true);
|
||||
stopAssignmentClient();
|
||||
}
|
||||
|
||||
|
@ -173,6 +175,7 @@ void AssignmentClient::sendStatusPacketToACM() {
|
|||
|
||||
void AssignmentClient::sendAssignmentRequest() {
|
||||
if (!_currentAssignment && !_isAssigned) {
|
||||
crash::annotations::setShutdownState(false);
|
||||
|
||||
auto nodeList = DependencyManager::get<NodeList>();
|
||||
|
||||
|
@ -289,6 +292,8 @@ void AssignmentClient::handleAuthenticationRequest() {
|
|||
}
|
||||
|
||||
void AssignmentClient::assignmentCompleted() {
|
||||
crash::annotations::setShutdownState(true);
|
||||
|
||||
// we expect that to be here the previous assignment has completely cleaned up
|
||||
assert(_currentAssignment.isNull());
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <AccountManager.h>
|
||||
#include <AssetClient.h>
|
||||
#include <BuildInfo.h>
|
||||
#include <CrashAnnotations.h>
|
||||
#include <DependencyManager.h>
|
||||
#include <HifiConfigVariantMap.h>
|
||||
#include <HTTPConnection.h>
|
||||
|
@ -432,6 +433,10 @@ DomainServer::~DomainServer() {
|
|||
DependencyManager::destroy<LimitedNodeList>();
|
||||
}
|
||||
|
||||
void DomainServer::aboutToQuit() {
|
||||
crash::annotations::setShutdownState(true);
|
||||
}
|
||||
|
||||
void DomainServer::queuedQuit(QString quitMessage, int exitCode) {
|
||||
if (!quitMessage.isEmpty()) {
|
||||
qWarning() << qPrintable(quitMessage);
|
||||
|
|
|
@ -136,6 +136,8 @@ private slots:
|
|||
void tokenGrantFinished();
|
||||
void profileRequestFinished();
|
||||
|
||||
void aboutToQuit();
|
||||
|
||||
signals:
|
||||
void iceServerChanged();
|
||||
void userConnected();
|
||||
|
|
|
@ -15,9 +15,10 @@
|
|||
// 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 <SharedUtil.h>
|
||||
#include <BuildInfo.h>
|
||||
|
||||
#include "DomainServer.h"
|
||||
|
||||
|
@ -32,6 +33,7 @@ int main(int argc, char* argv[]) {
|
|||
|
||||
// use a do-while to handle domain-server restart
|
||||
do {
|
||||
crash::annotations::setShutdownState(false);
|
||||
DomainServer domainServer(argc, argv);
|
||||
currentExitCode = domainServer.exec();
|
||||
} while (currentExitCode == DomainServer::EXIT_CODE_REBOOT);
|
||||
|
@ -39,4 +41,3 @@ int main(int argc, char* argv[]) {
|
|||
qInfo() << "Quitting.";
|
||||
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