Itamar Heim 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 <aha...@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: Itamar Heim: Verified; Looks good to me, approved -- To view, visit http://gerrit.ovirt.org/19885 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icaca2a3849a9fefbc33b055c6f4d2dd32959ad28 Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.3 Gerrit-Owner: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Itamar Heim <ih...@redhat.com> Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com> Gerrit-Reviewer: Roy Golan <rgo...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches