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

ahadas at redhat.com ahadas at redhat.com
Tue Dec 16 14:23:15 UTC 2014


Arik Hadas 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/1169879
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, 107 insertions(+), 0 deletions(-)

Approvals:
  Shahar Havivi: Looks good to me, approved
  Arik Hadas: Verified



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I91320cfd50fc7a12b01afae2885a783c0516a6df
Gerrit-PatchSet: 9
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
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: Oved Ourfali <oourfali at redhat.com>
Gerrit-Reviewer: Shahar Havivi <shavivi at redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list