Merge pull request #14610 from roxanneskelly/Case20106

Case 20106-AC agents spawned with -n don't come back
This commit is contained in:
Jeff Clinton 2019-01-02 11:07:40 -08:00 committed by GitHub
commit d5ef7ba175
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -276,6 +276,7 @@ void AssignmentClientMonitor::checkSpares() {
// Spawn or kill children, as needed. If --min or --max weren't specified, allow the child count // 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. // to drift up or down as far as needed.
if (spareCount < 1 || totalCount < _minAssignmentClientForks) { if (spareCount < 1 || totalCount < _minAssignmentClientForks) {
if (!_maxAssignmentClientForks || totalCount < _maxAssignmentClientForks) { if (!_maxAssignmentClientForks || totalCount < _maxAssignmentClientForks) {
spawnChildClient(); spawnChildClient();
@ -307,7 +308,7 @@ void AssignmentClientMonitor::handleChildStatusPacket(QSharedPointer<ReceivedMes
AssignmentClientChildData* childData = nullptr; AssignmentClientChildData* childData = nullptr;
if (!matchingNode) { 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 || if (senderSockAddr.getAddress() == QHostAddress::LocalHost ||
senderSockAddr.getAddress() == QHostAddress::LocalHostIPv6) { senderSockAddr.getAddress() == QHostAddress::LocalHostIPv6) {
@ -316,9 +317,9 @@ void AssignmentClientMonitor::handleChildStatusPacket(QSharedPointer<ReceivedMes
matchingNode = DependencyManager::get<LimitedNodeList>()->addOrUpdateNode(senderID, NodeType::Unassigned, matchingNode = DependencyManager::get<LimitedNodeList>()->addOrUpdateNode(senderID, NodeType::Unassigned,
senderSockAddr, senderSockAddr); senderSockAddr, senderSockAddr);
auto childData = std::unique_ptr<AssignmentClientChildData> auto newChildData = std::unique_ptr<AssignmentClientChildData>
{ new AssignmentClientChildData(Assignment::Type::AllTypes) }; { new AssignmentClientChildData(Assignment::Type::AllTypes) };
matchingNode->setLinkedData(std::move(childData)); matchingNode->setLinkedData(std::move(newChildData));
} else { } else {
// tell unknown assignment-client child to exit. // tell unknown assignment-client child to exit.
qDebug() << "Asking unknown child at" << senderSockAddr << "to exit."; qDebug() << "Asking unknown child at" << senderSockAddr << "to exit.";
@ -329,9 +330,8 @@ void AssignmentClientMonitor::handleChildStatusPacket(QSharedPointer<ReceivedMes
return; return;
} }
} }
} else {
childData = dynamic_cast<AssignmentClientChildData*>(matchingNode->getLinkedData());
} }
childData = dynamic_cast<AssignmentClientChildData*>(matchingNode->getLinkedData());
if (childData) { if (childData) {
// update our records about how to reach this child // update our records about how to reach this child