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

rgolan at redhat.com rgolan at redhat.com
Mon Feb 10 14:16:58 UTC 2014


Roy Golan 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.

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/24239
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6109ef0ea4869b59a93be6fef4b0c3cff50da62e
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Roy Golan <rgolan at redhat.com>
Gerrit-Reviewer: Mark Huth <mhuth at redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofrenkel at redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list