mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 13:58:51 +02:00
cleanups
This commit is contained in:
parent
907be67135
commit
4bba4fc387
5 changed files with 8 additions and 17 deletions
|
@ -203,7 +203,7 @@ void AssignmentClient::sendAssignmentRequest() {
|
||||||
qDebug () << "- will attempt to connect to domain-server on" << _assignmentServerSocket.getPort();
|
qDebug () << "- will attempt to connect to domain-server on" << _assignmentServerSocket.getPort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeList->sendAssignment(_requestAssignment);
|
nodeList->sendAssignment(_requestAssignment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,10 +13,7 @@
|
||||||
|
|
||||||
#include <LogHandler.h>
|
#include <LogHandler.h>
|
||||||
#include <ShutdownEventListener.h>
|
#include <ShutdownEventListener.h>
|
||||||
|
#include <AddressManager.h>
|
||||||
|
|
||||||
#include <AddressManager.h> // XXX need this?
|
|
||||||
|
|
||||||
|
|
||||||
#include "AssignmentClientMonitor.h"
|
#include "AssignmentClientMonitor.h"
|
||||||
#include "PacketHeaders.h"
|
#include "PacketHeaders.h"
|
||||||
|
@ -52,7 +49,6 @@ AssignmentClientMonitor::AssignmentClientMonitor(int &argc, char **argv, const u
|
||||||
// create a NodeList so we can receive stats from children
|
// create a NodeList so we can receive stats from children
|
||||||
DependencyManager::registerInheritance<LimitedNodeList, NodeList>();
|
DependencyManager::registerInheritance<LimitedNodeList, NodeList>();
|
||||||
auto addressManager = DependencyManager::set<AddressManager>();
|
auto addressManager = DependencyManager::set<AddressManager>();
|
||||||
// auto nodeList = DependencyManager::set<NodeList>(NodeType::Unassigned);
|
|
||||||
auto nodeList = DependencyManager::set<LimitedNodeList>(DEFAULT_ASSIGNMENT_CLIENT_MONITOR_PORT,
|
auto nodeList = DependencyManager::set<LimitedNodeList>(DEFAULT_ASSIGNMENT_CLIENT_MONITOR_PORT,
|
||||||
DEFAULT_ASSIGNMENT_CLIENT_MONITOR_DTLS_PORT);
|
DEFAULT_ASSIGNMENT_CLIENT_MONITOR_DTLS_PORT);
|
||||||
|
|
||||||
|
@ -89,7 +85,7 @@ void AssignmentClientMonitor::spawnChildClient() {
|
||||||
|
|
||||||
// make sure that the output from the child process appears in our output
|
// make sure that the output from the child process appears in our output
|
||||||
assignmentClient->setProcessChannelMode(QProcess::ForwardedChannels);
|
assignmentClient->setProcessChannelMode(QProcess::ForwardedChannels);
|
||||||
|
|
||||||
assignmentClient->start(applicationFilePath(), _childArguments);
|
assignmentClient->start(applicationFilePath(), _childArguments);
|
||||||
qDebug() << "Spawned a child client with PID" << assignmentClient->pid();
|
qDebug() << "Spawned a child client with PID" << assignmentClient->pid();
|
||||||
}
|
}
|
||||||
|
@ -102,8 +98,6 @@ void AssignmentClientMonitor::checkSpares() {
|
||||||
|
|
||||||
nodeList->removeSilentNodes();
|
nodeList->removeSilentNodes();
|
||||||
|
|
||||||
qDebug() << "check spares:";
|
|
||||||
|
|
||||||
nodeList->eachNode([&](const SharedNodePointer& node){
|
nodeList->eachNode([&](const SharedNodePointer& node){
|
||||||
AssignmentClientChildData *childData = static_cast<AssignmentClientChildData*>(node->getLinkedData());
|
AssignmentClientChildData *childData = static_cast<AssignmentClientChildData*>(node->getLinkedData());
|
||||||
qDebug() << " " << node->getUUID() << childData->getChildType();
|
qDebug() << " " << node->getUUID() << childData->getChildType();
|
||||||
|
@ -113,10 +107,11 @@ void AssignmentClientMonitor::checkSpares() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
qDebug() << " spare count is" << spareCount;
|
if (spareCount != 1) {
|
||||||
|
qDebug() << " spare count is" << spareCount;
|
||||||
|
}
|
||||||
|
|
||||||
if (spareCount < 1) {
|
if (spareCount < 1) {
|
||||||
qDebug() << "FORK";
|
|
||||||
spawnChildClient();
|
spawnChildClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,14 +45,11 @@ public:
|
||||||
|
|
||||||
void stopChildProcesses();
|
void stopChildProcesses();
|
||||||
private slots:
|
private slots:
|
||||||
// void childProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
|
||||||
void readPendingDatagrams();
|
void readPendingDatagrams();
|
||||||
void checkSpares();
|
void checkSpares();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void spawnChildClient();
|
void spawnChildClient();
|
||||||
// QList<QPointer<QProcess> > _childProcesses;
|
|
||||||
|
|
||||||
QStringList _childArguments;
|
QStringList _childArguments;
|
||||||
QTimer _checkSparesTimer; // every few seconds see if it need fewer or more spare children
|
QTimer _checkSparesTimer; // every few seconds see if it need fewer or more spare children
|
||||||
};
|
};
|
||||||
|
|
|
@ -244,7 +244,7 @@ void DomainServer::setupNodeListAndAssignments(const QUuid& sessionUUID) {
|
||||||
populateStaticScriptedAssignmentsFromSettings();
|
populateStaticScriptedAssignmentsFromSettings();
|
||||||
|
|
||||||
auto nodeList = DependencyManager::set<LimitedNodeList>(domainServerPort, domainServerDTLSPort);
|
auto nodeList = DependencyManager::set<LimitedNodeList>(domainServerPort, domainServerDTLSPort);
|
||||||
|
|
||||||
// no matter the local port, save it to shared mem so that local assignment clients can ask what it is
|
// no matter the local port, save it to shared mem so that local assignment clients can ask what it is
|
||||||
nodeList->putLocalPortIntoSharedMemory(DOMAIN_SERVER_LOCAL_PORT_SMEM_KEY, this);
|
nodeList->putLocalPortIntoSharedMemory(DOMAIN_SERVER_LOCAL_PORT_SMEM_KEY, this);
|
||||||
|
|
||||||
|
|
|
@ -25,9 +25,8 @@
|
||||||
#include <qset.h>
|
#include <qset.h>
|
||||||
#include <qsharedpointer.h>
|
#include <qsharedpointer.h>
|
||||||
#include <QtNetwork/qudpsocket.h>
|
#include <QtNetwork/qudpsocket.h>
|
||||||
#include <QSharedMemory>
|
|
||||||
|
|
||||||
#include <QtNetwork/qhostaddress.h>
|
#include <QtNetwork/qhostaddress.h>
|
||||||
|
#include <QSharedMemory>
|
||||||
|
|
||||||
#include <tbb/concurrent_unordered_map.h>
|
#include <tbb/concurrent_unordered_map.h>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue