Change in ovirt-engine[ovirt-engine-3.5]: core: filter duplicate requests to run the same vm

tnisan at redhat.com tnisan at redhat.com
Thu Dec 18 10:07:05 UTC 2014


Tal Nisan has submitted this change and it was merged.

Change subject: core: filter duplicate requests to run the same vm
......................................................................


core: filter duplicate requests to run the same vm

If engine gets multiple requests to run the same VM at the same time
(with MultipleActionRunner), we might get into a situation where the VM
does not run and kept locked.

Say we got 2 run requests for the same VM:
- The first command acquires the lock for the VM
- The second command fails to acquire the lock
- The can-do-action phase of the first command succeed
- We sort the commands before invoking them. As part of the sort, we map
  Id of VM to its run command. Since we iterate the commands in the same
  order they were received, we end up with mapping the second command
- Since the second command didn't manage to acquire the lock, it won't
  run
Since the first command does not run, it won't release its lock.

The solution is to filter the given parameters from duplicate requests
to run the same VM. We now override the hashCode and equals methods in
RunVmParams class so if we will get duplicate instances, they will be
filtered while we insert them to a Set in MultipleActionRunner.

Change-Id: I91320cfd50fc7a12b01afae2885a783c0516a6df
Bug-Url: https://bugzilla.redhat.com/1174815
Signed-off-by: Arik Hadas <ahadas at redhat.com>
---
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/RunVmOnceParams.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/RunVmParams.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VmOperationParameterBase.java
3 files changed, 103 insertions(+), 0 deletions(-)

Approvals:
  Arik Hadas: Verified
  Moti Asayag: Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I91320cfd50fc7a12b01afae2885a783c0516a6df
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Arik Hadas <ahadas at redhat.com>
Gerrit-Reviewer: Arik Hadas <ahadas at redhat.com>
Gerrit-Reviewer: Moti Asayag <masayag at redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list