Change in ovirt-engine[master]: core: fix NPE in decreasePendingVms

ofrenkel at redhat.com ofrenkel at redhat.com
Thu Oct 3 14:54:41 UTC 2013


Omer Frenkel has submitted this change and it was merged.

Change subject: core: fix NPE in decreasePendingVms
......................................................................


core: fix NPE in decreasePendingVms

There was a race between the VdsUpdateRunTimeInfo thread that invokes
RunVmCommandBase#decreasePendingVms method through OnPowerringUp
callback and the thread that invokes MigrateVmCommand#rerun (the thread
is created in VdsEventListener#rerun). The 'rerun thread' was doing
'setVm(null)' in order to refresh the VM on the next getVm invocation
and the VdsUpdateRunTimeInfo thread was trying to the get the VM using
the 'getVm' method VM in the same time - as a result of this race, the
VdsUpdateRunTimeInfo thread might end up with null VM which results in
NPE.

The solution is to change the VdsUpdateRunTimeInfo thread to fetch the
VM directly from the DB instead of using the 'getVm' method, And since
we don't need the dynamic info of the VM we can query only the static
part of the VM.

Change-Id: Icaca2a3849a9fefbc33b055c6f4d2dd32959ad28
Bug-Url: https://bugzilla.redhat.com/1000824
Signed-off-by: Arik Hadas <ahadas at redhat.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommandBase.java
1 file changed, 24 insertions(+), 8 deletions(-)

Approvals:
  Omer Frenkel: Verified; Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icaca2a3849a9fefbc33b055c6f4d2dd32959ad28
Gerrit-PatchSet: 2
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: Omer Frenkel <ofrenkel at redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan at redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list