Merge pull request #16285 from SimonWalton-HiFi/domain-server-logging-for-paging

DEV-2292: Alerting requirements for domain-server failure cases
This commit is contained in:
Shannon Romano 2019-10-04 14:01:56 -07:00 committed by GitHub
commit 24dc4b19ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 11 deletions

View file

@ -385,7 +385,7 @@ void DomainServer::parseCommandLine(int argc, char* argv[]) {
}
if (_iceServerAddr.isEmpty()) {
qCWarning(domain_server_ice) << "Could not parse an IP address and port combination from" << hostnamePortString;
qCWarning(domain_server_ice) << "ALERT: Could not parse an IP address and port combination from" << hostnamePortString;
::exit(0);
}
}
@ -876,7 +876,7 @@ void DomainServer::setupAutomaticNetworking() {
nodeList->startSTUNPublicSocketUpdate();
}
} else {
qDebug() << "Cannot enable domain-server automatic networking without a domain ID."
qCCritical(domain_server) << "PAGE: Cannot enable domain-server automatic networking without a domain ID."
<< "Please add an ID to your config file or via the web interface.";
return;
}
@ -1635,8 +1635,9 @@ void DomainServer::handleFailedICEServerAddressUpdate(QNetworkReply* requestRepl
} else {
const int ICE_SERVER_UPDATE_RETRY_MS = 2 * 1000;
qCWarning(domain_server_ice) << "Failed to update ice-server address (" << _iceServerSocket << ") with High Fidelity Metaverse - error was"
<< requestReply->errorString();
qCWarning(domain_server_ice) << "PAGE: Failed to update ice-server address (" << _iceServerSocket <<
") with Metaverse (" << requestReply->url() << ") (critical error for auto-networking) error:" <<
requestReply->errorString();
qCWarning(domain_server_ice) << "\tRe-attempting in" << ICE_SERVER_UPDATE_RETRY_MS / 1000 << "seconds";
QTimer::singleShot(ICE_SERVER_UPDATE_RETRY_MS, this, SLOT(sendICEServerAddressToMetaverseAPI()));
@ -3450,8 +3451,9 @@ void DomainServer::randomizeICEServerAddress(bool shouldTriggerHostLookup) {
// we ended up with an empty list since everything we've tried has failed
// so clear the set of failed addresses and start going through them again
qCWarning(domain_server_ice) << "All current ice-server addresses have failed - re-attempting all current addresses for"
<< _iceServerAddr;
qCWarning(domain_server_ice) <<
"PAGE: All current ice-server addresses have failed - re-attempting all current addresses for"
<< _iceServerAddr;
_failedIceServerAddresses.clear();
candidateICEAddresses = _iceServerAddresses;

View file

@ -1035,7 +1035,7 @@ void AccountManager::publicKeyUploadSucceeded(QNetworkReply* reply) {
void AccountManager::publicKeyUploadFailed(QNetworkReply* reply) {
// the public key upload has failed
qWarning() << "Public key upload failed from AccountManager" << reply->errorString();
qCritical() << "PAGE: Public key upload failed from AccountManager to" << reply->url() << reply->errorString();
// we aren't waiting for a response any longer
_isWaitingForKeypairResponse = false;

View file

@ -52,7 +52,7 @@ LimitedNodeList::LimitedNodeList(int socketListenPort, int dtlsListenPort) :
_nodeSocket.bind(QHostAddress::AnyIPv4, port);
quint16 assignedPort = _nodeSocket.localPort();
if (socketListenPort != INVALID_PORT && socketListenPort != 0 && socketListenPort != assignedPort) {
qCCritical(networking) << "NodeList is unable to assign requested port of" << socketListenPort;
qCCritical(networking) << "PAGE: NodeList is unable to assign requested port of" << socketListenPort;
}
qCDebug(networking) << "NodeList socket is listening on" << assignedPort;
@ -1155,6 +1155,7 @@ void LimitedNodeList::startSTUNPublicSocketUpdate() {
void LimitedNodeList::possiblyTimeoutSTUNAddressLookup() {
if (_stunSockAddr.getAddress().isNull()) {
// our stun address is still NULL, but we've been waiting for long enough - time to force a fail
qCCritical(networking) << "PAGE: Failed to lookup address of STUN server" << STUN_SERVER_HOSTNAME;
stopInitialSTUNUpdate(false);
}
}
@ -1170,7 +1171,7 @@ void LimitedNodeList::stopInitialSTUNUpdate(bool success) {
if (!success) {
// if we're here this was the last failed STUN request
// use our DS as our stun server
qCDebug(networking, "Failed to lookup public address via STUN server at %s:%hu.",
qCWarning(networking, "PAGE: Failed to lookup public address via STUN server at %s:%hu (likely a critical error for auto-networking).",
STUN_SERVER_HOSTNAME, STUN_SERVER_PORT);
qCDebug(networking) << "LimitedNodeList public socket will be set with local port and null QHostAddress.";
@ -1212,7 +1213,8 @@ void LimitedNodeList::updateLocalSocket() {
QTcpSocket* localIPTestSocket = new QTcpSocket;
connect(localIPTestSocket, &QTcpSocket::connected, this, &LimitedNodeList::connectedForLocalSocketTest);
connect(localIPTestSocket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(errorTestingLocalSocket()));
connect(localIPTestSocket, static_cast<void(QTcpSocket::*)(QAbstractSocket::SocketError)>(&QTcpSocket::error),
this, &LimitedNodeList::errorTestingLocalSocket);
// attempt to connect to our reliable host
localIPTestSocket->connectToHost(RELIABLE_LOCAL_IP_CHECK_HOST, RELIABLE_LOCAL_IP_CHECK_PORT);
@ -1242,6 +1244,8 @@ void LimitedNodeList::errorTestingLocalSocket() {
// then use our possibly updated guessed local address as fallback
if (!_hasTCPCheckedLocalSocket) {
setLocalSocket(HifiSockAddr { getGuessedLocalAddress(), _nodeSocket.localPort() });
qCCritical(networking) << "PAGE: Can't connect to Google DNS service via TCP, falling back to guessed local address"
<< getLocalSockAddr();
}
localIPTestSocket->deleteLater();
@ -1325,7 +1329,7 @@ void LimitedNodeList::putLocalPortIntoSharedMemory(const QString key, QObject* p
qCDebug(networking) << "Wrote local listening port" << localPort << "to shared memory at key" << key;
} else {
qWarning() << "Failed to create and attach to shared memory to share local port with assignment-client children.";
qWarning() << "ALERT: Failed to create and attach to shared memory to share local port with assignment-client children.";
}
}