From 4c1ba8b1aa3883c721edd77651e68f216bc6bb4a Mon Sep 17 00:00:00 2001 From: Roxanne Skelly <roxanne@highfidelity.io> Date: Tue, 18 Dec 2018 16:33:13 -0800 Subject: [PATCH 1/2] Case 20106-AC agents spawned with -n don't come back with the expected amount after a domain restart They were being incorrectly marked as 'unassigned' in the assignment client monitor. --- assignment-client/src/AssignmentClientMonitor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assignment-client/src/AssignmentClientMonitor.cpp b/assignment-client/src/AssignmentClientMonitor.cpp index 330023dae0..98b7cbce1b 100644 --- a/assignment-client/src/AssignmentClientMonitor.cpp +++ b/assignment-client/src/AssignmentClientMonitor.cpp @@ -276,6 +276,7 @@ void AssignmentClientMonitor::checkSpares() { // Spawn or kill children, as needed. If --min or --max weren't specified, allow the child count // to drift up or down as far as needed. + if (spareCount < 1 || totalCount < _minAssignmentClientForks) { if (!_maxAssignmentClientForks || totalCount < _maxAssignmentClientForks) { spawnChildClient(); @@ -316,9 +317,9 @@ void AssignmentClientMonitor::handleChildStatusPacket(QSharedPointer<ReceivedMes matchingNode = DependencyManager::get<LimitedNodeList>()->addOrUpdateNode(senderID, NodeType::Unassigned, senderSockAddr, senderSockAddr); - auto childData = std::unique_ptr<AssignmentClientChildData> + auto newChildData = std::unique_ptr<AssignmentClientChildData> { new AssignmentClientChildData(Assignment::Type::AllTypes) }; - matchingNode->setLinkedData(std::move(childData)); + matchingNode->setLinkedData(std::move(newChildData)); } else { // tell unknown assignment-client child to exit. qDebug() << "Asking unknown child at" << senderSockAddr << "to exit."; @@ -329,9 +330,8 @@ void AssignmentClientMonitor::handleChildStatusPacket(QSharedPointer<ReceivedMes return; } } - } else { - childData = dynamic_cast<AssignmentClientChildData*>(matchingNode->getLinkedData()); } + childData = dynamic_cast<AssignmentClientChildData*>(matchingNode->getLinkedData()); if (childData) { // update our records about how to reach this child From eaeb111bf127b4c8b6d3667f18c117f568c0a99c Mon Sep 17 00:00:00 2001 From: Roxanne Skelly <roxanne@highfidelity.io> Date: Tue, 18 Dec 2018 16:50:30 -0800 Subject: [PATCH 2/2] Fix Typo --- assignment-client/src/AssignmentClientMonitor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assignment-client/src/AssignmentClientMonitor.cpp b/assignment-client/src/AssignmentClientMonitor.cpp index 98b7cbce1b..fefed6e143 100644 --- a/assignment-client/src/AssignmentClientMonitor.cpp +++ b/assignment-client/src/AssignmentClientMonitor.cpp @@ -308,7 +308,7 @@ void AssignmentClientMonitor::handleChildStatusPacket(QSharedPointer<ReceivedMes AssignmentClientChildData* childData = nullptr; if (!matchingNode) { - // The parent only expects to be talking with prorams running on this same machine. + // The parent only expects to be talking with programs running on this same machine. if (senderSockAddr.getAddress() == QHostAddress::LocalHost || senderSockAddr.getAddress() == QHostAddress::LocalHostIPv6) {