This commit is contained in:
Seth Alves 2015-02-20 13:44:37 -08:00
parent 907be67135
commit 4bba4fc387
5 changed files with 8 additions and 17 deletions

View file

@ -203,7 +203,7 @@ void AssignmentClient::sendAssignmentRequest() {
qDebug () << "- will attempt to connect to domain-server on" << _assignmentServerSocket.getPort();
}
}
nodeList->sendAssignment(_requestAssignment);
}
}

View file

@ -13,10 +13,7 @@
#include <LogHandler.h>
#include <ShutdownEventListener.h>
#include <AddressManager.h> // XXX need this?
#include <AddressManager.h>
#include "AssignmentClientMonitor.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
DependencyManager::registerInheritance<LimitedNodeList, NodeList>();
auto addressManager = DependencyManager::set<AddressManager>();
// auto nodeList = DependencyManager::set<NodeList>(NodeType::Unassigned);
auto nodeList = DependencyManager::set<LimitedNodeList>(DEFAULT_ASSIGNMENT_CLIENT_MONITOR_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
assignmentClient->setProcessChannelMode(QProcess::ForwardedChannels);
assignmentClient->start(applicationFilePath(), _childArguments);
qDebug() << "Spawned a child client with PID" << assignmentClient->pid();
}
@ -102,8 +98,6 @@ void AssignmentClientMonitor::checkSpares() {
nodeList->removeSilentNodes();
qDebug() << "check spares:";
nodeList->eachNode([&](const SharedNodePointer& node){
AssignmentClientChildData *childData = static_cast<AssignmentClientChildData*>(node->getLinkedData());
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) {
qDebug() << "FORK";
spawnChildClient();
}

View file

@ -45,14 +45,11 @@ public:
void stopChildProcesses();
private slots:
// void childProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
void readPendingDatagrams();
void checkSpares();
private:
void spawnChildClient();
// QList<QPointer<QProcess> > _childProcesses;
QStringList _childArguments;
QTimer _checkSparesTimer; // every few seconds see if it need fewer or more spare children
};

View file

@ -244,7 +244,7 @@ void DomainServer::setupNodeListAndAssignments(const QUuid& sessionUUID) {
populateStaticScriptedAssignmentsFromSettings();
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
nodeList->putLocalPortIntoSharedMemory(DOMAIN_SERVER_LOCAL_PORT_SMEM_KEY, this);

View file

@ -25,9 +25,8 @@
#include <qset.h>
#include <qsharedpointer.h>
#include <QtNetwork/qudpsocket.h>
#include <QSharedMemory>
#include <QtNetwork/qhostaddress.h>
#include <QSharedMemory>
#include <tbb/concurrent_unordered_map.h>