Commit 596c4c94 authored by Alessio Netti's avatar Alessio Netti
Browse files

Bugfixes

- Removed the dlclose call on plugin unloads to avoid segmentation fault
issues at destruction time of boost thread objects due to failed symbol resolution
- QueryEngine in DCDBPusher does not block anymore while being updated,
but simply returns NULL
parent 3fb69e50
......@@ -200,8 +200,8 @@ void AnalyticsManager::unloadPlugin(const string& id) {
if (it->configurator)
it->destroy(it->configurator);
if (it->DL)
dlclose(it->DL);
//if (it->DL)
// dlclose(it->DL);
if (id != "") {
_plugins.erase(it);
......
......@@ -33,12 +33,12 @@ void AnalyticsController::start() {
}
void AnalyticsController::stop() {
LOG(info) << "Stopping data analytics management thread...";
_keepRunning = false;
_mainThread.join();
LOG(info) << "Stopping sensors...";
_manager->stop();
_manager->clear();
LOG(info) << "Stopping data analytics management thread...";
_mainThread.join();
LOG(info) << "Stopping worker threads...";
_keepAliveWork.reset();
_threads.join_all();
......
......@@ -153,9 +153,9 @@ void PluginManager::unloadPlugin(const string& id) {
if (it->configurator) {
it->destroy(it->configurator);
}
if (it->DL) {
dlclose(it->DL);
}
//if (it->DL) {
// dlclose(it->DL);
//}
if (id != "") {
//only erase if we immediately return or otherwise our iterator would be invalidated
......
......@@ -338,7 +338,6 @@ void RestAPI::PUT_analytics_reload(endpointArgs) {
// Wait until MQTTPusher is paused in order to reload plugins
if (_mqttPusher->halt()) {
_manager->stop(plugin);
unloadQueryEngine();
if (!_manager->reload(_io, plugin)) {
......@@ -407,7 +406,6 @@ void RestAPI::PUT_analytics_unload(endpointArgs) {
return;
}
_manager->stop(plugin);
unloadQueryEngine();
_manager->unloadPlugin(plugin);
......
......@@ -76,8 +76,8 @@ QueryEngine& _queryEngine = QueryEngine::getInstance();
boost::shared_ptr<boost::asio::io_service::work> keepAliveWork;
std::vector<reading_t>* sensorQueryCallback(const string& name, const uint64_t startTs, const uint64_t endTs, std::vector<reading_t>* buffer, const bool rel) {
// Spinning on a lock if the query engine is being updated
while( _queryEngine.updating.load() ) {}
// Returning NULL if the query engine is being updated
if(_queryEngine.updating.load()) return NULL;
++_queryEngine.access;
std::vector<reading_t>* res = NULL;
shared_ptr<map<string, SBasePtr>> sensorMap = _queryEngine.getSensorMap();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment