Skip to content

Conversation

@frankdavid
Copy link
Contributor

@frankdavid frankdavid commented Oct 28, 2025

is_running

wait_for_shutdown used to call is_running which returned true iff the domain existed and was in VIR_DOMAIN_RUNNING state. However, we've observed that the code intermittently misbehaves.

According to our theory:

  • the VM is in VIR_DOMAIN_SHUTDOWN state
  • is_running return false
  • wait_for_shutdown returns
  • we try to clean up the temporary files which fails

The new logic:

  • If domain exists and running: all good (no changes here)
  • If domain exists but in crashed state: consider dead and log
  • If domain exists and is in any other state: consider running and log
  • If domain does not exist or its state cannot be queried: consider dead and log

try_destroy_existing_vm

We change the implementation to include a call to undefine. This may help remove the VM if it's in an odd state where it's defined but is not running.

wait_for_shutdown used to call is_running which returned true iff the domain existed and was in `VIR_DOMAIN_RUNNING` state. However, we've observed that the code misbehaves intermittently, according to our theory:
  - the VM is in `VIR_DOMAIN_SHUTDOWN` state
  - we decide the VM is not running
  - we try to clean up the temporary files which fails

The new logic:
  - If domain exists and running: all good (no changes here)
  - If domain exists but in crashed state: consider dead and log
  - If domain exists and is in any other state: consider running and log
  - If domain does not exist or its state cannot be queried: consider dead and log
@frankdavid frankdavid requested a review from a team as a code owner October 28, 2025 06:48
@github-actions github-actions bot added the fix label Oct 28, 2025
@github-actions github-actions bot added the @node label Oct 28, 2025
@frankdavid frankdavid enabled auto-merge November 3, 2025 09:10
@frankdavid frankdavid added this pull request to the merge queue Nov 3, 2025
Merged via the queue into master with commit 723496d Nov 3, 2025
38 checks passed
@frankdavid frankdavid deleted the frankdavid/vm-running branch November 3, 2025 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants