Change in ovirt-engine[ovirt-engine-3.4]: core: Prevent StopVm to interleave with other VM locked actions

iheim at redhat.com iheim at redhat.com
Thu Feb 13 10:50:37 UTC 2014


Itamar Heim has submitted this change and it was merged.

Change subject: core: Prevent StopVm to interleave with other VM locked actions
......................................................................


core: Prevent StopVm to interleave with other VM locked actions

Stop and Shutdown VM commands are calling the DestoryVds command which is contending on
the VdsManager lock. The lock is implemented as synchronized (object) -
this means that order isn't kept and we're subjected to JVM's scheduling
descisions so other commands, like RunVm can take the lock and result the Vm to stop instead of start

Fix: take an exclusive engine lock on Stop and Shutdown commands

This will also prevent a situation where asyncRunningVms has an entry
although the VM is down.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1038351
Change-Id: I6109ef0ea4869b59a93be6fef4b0c3cff50da62e
Signed-off-by: Roy Golan <rgolan at redhat.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ShutdownVmCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/StopVmCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/StopVmCommandBase.java
3 files changed, 20 insertions(+), 1 deletion(-)

Approvals:
  Roy Golan: Verified
  Omer Frenkel: Looks good to me, approved



-- 
To view, visit http://gerrit.ovirt.org/24378
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6109ef0ea4869b59a93be6fef4b0c3cff50da62e
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
Gerrit-Owner: Roy Golan <rgolan at redhat.com>
Gerrit-Reviewer: Itamar Heim <iheim at redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofrenkel at redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list