1
0
Fork 0

add debugging for CommTasks creation & destruction

This commit is contained in:
jsteemann 2019-05-16 10:37:12 +02:00
parent b7cfa24518
commit 73a7990a31
1 changed files with 8 additions and 0 deletions

View File

@ -55,12 +55,15 @@ void GeneralServer::registerTask(std::shared_ptr<rest::SocketTask> const& task)
if (application_features::ApplicationServer::isStopping()) {
THROW_ARANGO_EXCEPTION(TRI_ERROR_SHUTTING_DOWN);
}
LOG_TOPIC("29da9", WARN, Logger::FIXME) << "- registering CommTask with id " << task->id() << ", ptr: " << task.get();
MUTEX_LOCKER(locker, _tasksLock);
_commTasks.emplace(task->id(), task);
}
void GeneralServer::unregisterTask(uint64_t id) {
LOG_TOPIC("090d8", WARN, Logger::FIXME) << "- unregistering CommTask with id " << id;
MUTEX_LOCKER(locker, _tasksLock);
_commTasks.erase(id);
}
@ -123,6 +126,11 @@ void GeneralServer::stopWorking() {
LOG_TOPIC("f1549", DEBUG, Logger::FIXME) << "waiting for " << _commTasks.size() << " comm tasks to shut down";
std::this_thread::sleep_for(std::chrono::milliseconds(5));
MUTEX_LOCKER(lock, _tasksLock);
for (auto const& it : _commTasks) {
LOG_TOPIC("9b8ac", WARN, Logger::FIXME) << "- our friend is: " << it.first << " -> " << it.second.get();
}
}
}