Repository navigation
B #8181: Update running_stime when VM transitions from BOOT to RUNNING - #8182
trukhinyuri wants to merge 1 commit into
Conversation
… to RUNNING Commit 038e342 added ignore_state_update() in InformationManager to ignore stale monitoring state updates for 30s after running_stime or running_etime. However, LifeCycleManager::trigger_deploy_success only updated running_stime in the MIGRATE branch and did not update running_stime when transitioning from BOOT* states to RUNNING (leaving running_stime at the timestamp when PROLOG completed and BOOT started, or when an earlier boot failed). When vmm/deploy or vmm/restore takes 30s or longer (or after recovering from BOOT_FAILURE), time(0) - vm->get_running_stime() is already >= 30s at the moment the VM enters RUNNING, allowing an in-flight SYNC_STATE poll collected before deploy completion to immediately transition the newly RUNNING VM to POWEROFF. Update vm->set_running_stime(time(0)) in the BOOT* branch of LifeCycleManager::trigger_deploy_success. Signed-off-by: Iurii Trukhin <yuri@trukhin.com>
There was a problem hiding this comment.
🟢 Approval recommended
The focused change correctly addresses the stale state-update race and matches existing lifecycle behavior.
0 open findings
What changed in this PR
Refreshes the VM running timestamp after successful BOOT* deployment, preserving the 30-second stale-monitoring protection.
Changes:
- Sets
running_stimewhen transitioning fromBOOT*toRUNNING. - Aligns boot behavior with migration handling.
| File | Description |
|---|---|
src/lcm/LifeCycleStates.cc |
Refreshes the running timestamp after successful deployment. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
paczerny
left a comment
There was a problem hiding this comment.
The new assignment also applies to BOOT_UNKNOWN. Restarting from UNKNOWN reuses the existing history record, so replacing its RSTIME erases the running interval before recovery. Showback derives running hours from this timestamp; when running-only billing is enabled, CPU and memory charges also lose that interval.
Description
Fixes #8181.
In
LifeCycleManager::trigger_deploy_success()(src/lcm/LifeCycleStates.cc),vm->set_running_stime()is updated in theMIGRATEbranch (line 325) but not in theBOOT*branch (lines 353-378). Becauserunning_stimeis otherwise set whenPROLOGcompletes (prolog_success_action) or whenBOOT_POWEROFF/BOOT_SUSPENDEDstarts (and not refreshed when recovering fromBOOT_FAILURE/BOOT_UNKNOWN), avmm/deployorvmm/restorethat takes 30s or longer reachesRUNNINGwithtime(0) - vm->get_running_stime() >= 30.When that happens, the 30s grace window in
InformationManager::ignore_state_update()(038e3420ed) no longer applies, so an in-flightSYNC_STATEpoll collected just before deploy completion can move the newly started VM straight toPOWEROFF.This change sets
vm->set_running_stime(time(0))in theBOOT*branch oftrigger_deploy_success()as well.Branches to which this PR applies