mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
M #-: Fix occasional crash on exit (#1242)
This commit is contained in:
parent
8348f361ad
commit
8d19f067fd
@ -21,6 +21,8 @@
|
||||
#include "DriverManager.h"
|
||||
#include "Listener.h"
|
||||
|
||||
#include <atomic>
|
||||
|
||||
class MarketPlacePool;
|
||||
class MarketPlaceAppPool;
|
||||
class ImagePool;
|
||||
@ -60,6 +62,8 @@ public:
|
||||
*/
|
||||
void finalize()
|
||||
{
|
||||
terminate = true;
|
||||
|
||||
timer_thread.stop();
|
||||
|
||||
DriverManager::stop(drivers_timeout);
|
||||
@ -167,6 +171,11 @@ private:
|
||||
*/
|
||||
RaftManager * raftm = nullptr;
|
||||
|
||||
/**
|
||||
* Manager is terminating, do not execute any action
|
||||
*/
|
||||
std::atomic<bool> terminate{false};
|
||||
|
||||
/**
|
||||
* Returns a pointer to the marketplace driver.
|
||||
* @return the marketplace manager driver or 0 in not found
|
||||
|
@ -253,6 +253,11 @@ void MarketPlaceManager::_monitor(unique_ptr<market_msg_t> msg)
|
||||
|
||||
for (int i=0; i< num; i++)
|
||||
{
|
||||
if (terminate)
|
||||
{
|
||||
return; // Prevent crash on exit, while processing long msg
|
||||
}
|
||||
|
||||
int app_id;
|
||||
int rc = apppool->import(apps[i]->value(), id, name, app_id, err);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user