New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qmemman sometimes doesn't notice that VM is no longer running #1409

Closed
marmarek opened this Issue Nov 12, 2015 · 2 comments

Comments

Projects
None yet
1 participant
@marmarek
Member

marmarek commented Nov 12, 2015

When it happens, it still tries to assign memory to such VM (so such memory isn't assigned to other VMs - in unused). As part of such assignment, it writes to xenstore /local/domain/XID/memory/target, which means that even if VM xenstore directory was already removed, it is recreated. And because of that, qmemman will still think the VM is running, because it uses xenstore-list /local/domain (equivalent) to enumerate running VMs (when @releaseDomain xenstore watch fires).

This is just another issue, which happens only when running our automated tests - haven't spotted in real usage.

@marmarek marmarek added this to the Release 3.1 milestone Nov 12, 2015

marmarek added a commit to QubesOS/qubes-core-admin that referenced this issue Jan 15, 2016

qmemman: improve check whether VM is still running
In some cases it may happen that qmemman or other application using
xenstore will re-create VM directory in xenstore just after VM was
destroyed. For example when multiple VMs was destroyed at the same time,
but qmemman will kick off just at first @releaseDomain event - other VMs
will still be there (at xenstore-list time). This means that qmemman
will consider them when redistributing memory (of just destroyed one),
so will update memory/target entry of every "running" VM. And at this
point it may recreate VM directory of another already destroyed VM.

Generally fixing this race condition would require running all the
operations (from xenstore-ls, to setting memory/target) in a single
xenstore transaction. But this can be lengthly process. And if any other
modification happens in the meantime, transaction will rejected and
qmemman would need to redo all the changes. Not worth the effort.

Fixes QubesOS/qubes-issues#1409

(cherry picked from commit fef8761)
@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jan 15, 2016

Member

Automated announcement from builder-github

The package qubes-core-dom0-3.0.27-1.fc20 has been pushed to the r3.0 testing repository for dom0.
To test this update, please install it with the following command:

sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing

Changes included in this update

Member

marmarek commented Jan 15, 2016

Automated announcement from builder-github

The package qubes-core-dom0-3.0.27-1.fc20 has been pushed to the r3.0 testing repository for dom0.
To test this update, please install it with the following command:

sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 13, 2016

Member

Automated announcement from builder-github

The package qubes-core-dom0-3.0.28-1.fc20 has been pushed to the r3.0 stable repository for dom0.
To install this update, please use the standard update command:

sudo qubes-dom0-update

Or update dom0 via Qubes Manager.

Changes included in this update

Member

marmarek commented Mar 13, 2016

Automated announcement from builder-github

The package qubes-core-dom0-3.0.28-1.fc20 has been pushed to the r3.0 stable repository for dom0.
To install this update, please use the standard update command:

sudo qubes-dom0-update

Or update dom0 via Qubes Manager.

Changes included in this update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment