B #7058: Solve IM vs VMM race conditions (#3759)

This commit is contained in:
Pavel Czerný authored and GitHub committed 2025-09-03 10:08:16 +02:00
1 parent 01539eee0b
commit cc62c31a89
2 files changed
+12 -9

No files matched your search

+11
View File
@@ -331,6 +331,17 @@ void InformationManager::_host_system(unique_ptr<im_msg_t> msg)
static void test_and_trigger(const string& state_str, VirtualMachine * vm)
{
time_t the_time = time(0);
// Prevent Monitor and VMM driver race condition.
// Ignore state updates for 30s after state changes
if ( the_time - vm->get_running_etime() < 30 ||
the_time - vm->get_running_stime() < 30 )
{
vm->log("VMM", Log::INFO, "Ignoring VM state update");
return;
}
auto state = vm->get_state();
auto lcm_state = vm->get_lcm_state();
auto lcm = Nebula::instance().get_lcm();
+1 -9
View File
@@ -307,7 +307,7 @@ void LifeCycleManager::trigger_deploy_success(int vid)
int uid = vm->get_uid();
int gid = vm->get_gid();
int plan_id = vm->plan_id();
int action_id = vm->action_id();
@@ -1242,14 +1242,6 @@ void LifeCycleManager::trigger_monitor_poweron(int vid)
time_t the_time = time(0);
// Prevent Monitor and VMM driver race condition.
// Ignore state updates for 30s after state changes
if ( the_time - vm->get_running_etime() < 30 )
{
vm->log("VMM", Log::INFO, "Ignoring VM state update");
return;
}
int uid = vm->get_uid();
int gid = vm->get_gid();