History

Remove debugging code, some thread safety changes

Roxanne Skelly committed 7 years ago

Commit c7b04861 parent 1e1437a5 files · +23 −59Browse files

Showing the changes to libraries/networking/src/ThreadedAssignment.cpp (1 of 5 files). Show all

Unified · Split

libraries/networking/src/ThreadedAssignment.cpp+4−7
@@ -37,7 +37,6 @@ ThreadedAssignment::ThreadedAssignment(ReceivedMessage& message) : · 36 unmodified lines
37 // if the NL tells us we got a DS response, clear our member variable of queued check-ins37 // if the NL tells us we got a DS response, clear our member variable of queued check-ins
38 auto nodeList = DependencyManager::get<NodeList>();38 auto nodeList = DependencyManager::get<NodeList>();
39 connect(nodeList.data(), &NodeList::receivedDomainServerList, this, &ThreadedAssignment::clearQueuedCheckIns);39 connect(nodeList.data(), &NodeList::receivedDomainServerList, this, &ThreadedAssignment::clearQueuedCheckIns);
40 timestamp = p_high_resolution_clock::now();
41}40}
42 41
43void ThreadedAssignment::setFinished(bool isFinished) {42void ThreadedAssignment::setFinished(bool isFinished) {
@@ -106,8 +105,6 @@ void ThreadedAssignment::addPacketStatsAndSendStatsPacket(QJsonObject statsObjec · 62 unmodified lines
106 QJsonObject assignmentStats;105 QJsonObject assignmentStats;
107 assignmentStats["numQueuedCheckIns"] = _numQueuedCheckIns;106 assignmentStats["numQueuedCheckIns"] = _numQueuedCheckIns;
108 107
109 assignmentStats["globalPostedEventCount"] = nodeList->getGlobalPostedEventCount();
110
111 statsObject["assignmentStats"] = assignmentStats;108 statsObject["assignmentStats"] = assignmentStats;
112 109
113 nodeList->sendStatsToDomainServer(statsObject);110 nodeList->sendStatsToDomainServer(statsObject);
@@ -121,16 +118,16 @@ void ThreadedAssignment::sendStatsPacket() { · 7 unmodified lines
121void ThreadedAssignment::checkInWithDomainServerOrExit() {118void ThreadedAssignment::checkInWithDomainServerOrExit() {
122 // verify that the number of queued check-ins is not >= our max119 // verify that the number of queued check-ins is not >= our max
123 // the number of queued check-ins is cleared anytime we get a response from the domain-server120 // 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 if (_numQueuedCheckIns >= MAX_SILENT_DOMAIN_SERVER_CHECK_INS) {121 if (_numQueuedCheckIns >= MAX_SILENT_DOMAIN_SERVER_CHECK_INS) {
128 qCDebug(networking) << "At least" << MAX_SILENT_DOMAIN_SERVER_CHECK_INS << "have been queued without a response from domain-server"122 qCDebug(networking) << "At least" << MAX_SILENT_DOMAIN_SERVER_CHECK_INS << "have been queued without a response from domain-server"
129 << "Stopping the current assignment";123 << "Stopping the current assignment";
130 stop();124 stop();
131 } else {125 } else {
132 auto nodeList = DependencyManager::get<NodeList>();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 // increase the number of queued check ins132 // increase the number of queued check ins
136 _numQueuedCheckIns++;133 _numQueuedCheckIns++;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t