Showing the changes to libraries/networking/src/ThreadedAssignment.cpp (1 of 5 files). Show all
Unified · Split
| @@ -37,7 +37,6 @@ ThreadedAssignment::ThreadedAssignment(ReceivedMessage& message) : · 36 unmodified lines | ||
| 37 | 37 | // if the NL tells us we got a DS response, clear our member variable of queued check-ins |
| 38 | 38 | auto nodeList = DependencyManager::get<NodeList>(); |
| 39 | 39 | connect(nodeList.data(), &NodeList::receivedDomainServerList, this, &ThreadedAssignment::clearQueuedCheckIns); |
| 40 | − timestamp = p_high_resolution_clock::now(); | |
| 41 | 40 | } |
| 42 | 41 | |
| 43 | 42 | void ThreadedAssignment::setFinished(bool isFinished) { |
| @@ -106,8 +105,6 @@ void ThreadedAssignment::addPacketStatsAndSendStatsPacket(QJsonObject statsObjec · 62 unmodified lines | ||
| 106 | 105 | QJsonObject assignmentStats; |
| 107 | 106 | assignmentStats["numQueuedCheckIns"] = _numQueuedCheckIns; |
| 108 | 107 | |
| 109 | − assignmentStats["globalPostedEventCount"] = nodeList->getGlobalPostedEventCount(); | |
| 110 | − | |
| 111 | 108 | statsObject["assignmentStats"] = assignmentStats; |
| 112 | 109 | |
| 113 | 110 | nodeList->sendStatsToDomainServer(statsObject); |
| @@ -121,16 +118,16 @@ void ThreadedAssignment::sendStatsPacket() { · 7 unmodified lines | ||
| 121 | 118 | void ThreadedAssignment::checkInWithDomainServerOrExit() { |
| 122 | 119 | // verify that the number of queued check-ins is not >= our max |
| 123 | 120 | // the number of queued check-ins is cleared anytime we get a response from the domain-server |
| 124 | − | |
| 125 | − timestamp = p_high_resolution_clock::now(); | |
| 126 | − | |
| 127 | 121 | if (_numQueuedCheckIns >= MAX_SILENT_DOMAIN_SERVER_CHECK_INS) { |
| 128 | 122 | qCDebug(networking) << "At least" << MAX_SILENT_DOMAIN_SERVER_CHECK_INS << "have been queued without a response from domain-server" |
| 129 | 123 | << "Stopping the current assignment"; |
| 130 | 124 | stop(); |
| 131 | 125 | } else { |
| 132 | 126 | auto nodeList = DependencyManager::get<NodeList>(); |
| 133 | − QMetaObject::invokeMethod(nodeList.data(), "sendDomainServerCheckIn", Qt::DirectConnection); | |
| 127 | + // Call sendDomainServerCheckIn directly instead of putting it on | |
| 128 | + // the event queue. Under high load, the event queue can back up | |
| 129 | + // longer than the total timeout period and cause a restart | |
| 130 | + nodeList->sendDomainServerCheckIn(); | |
| 134 | 131 | |
| 135 | 132 | // increase the number of queued check ins |
| 136 | 133 | _numQueuedCheckIns++; |