Change in vdsm[master]: vm: Improve error handling when Vm._dom is None

nsoffer at redhat.com nsoffer at redhat.com
Tue Aug 11 16:30:43 UTC 2015


Nir Soffer has posted comments on this change.

Change subject: vm: Improve error handling when Vm._dom is None
......................................................................


Patch Set 3:

(1 comment)

https://gerrit.ovirt.org/#/c/43225/3/vdsm/virt/sampling.py
File vdsm/virt/sampling.py:

Line 551:                 self._skip_doms[vm_id] = True
Line 552:             else:
Line 553:                 # TODO: This racy check may fail if the underlying libvirt
Line 554:                 # domain has died just after checking isDomainReadyForCommands
Line 555:                 # succeeded.
> note to self: fix in a future patch
The issue is is not only accessing private of a private (extremely evil :-), but  the fact that vm_obj._dom may be replaced behind your back with DisconnectedDomain, while you hold the old object, so the call you do later may use a invalid object or one that we should not access.

You should add vm_obj to the list, and handle DisconnectedError if the vm was disconnected while the periodic loop was trying to access it.
Line 556:                 doms.append(vm_obj._dom._dom)
Line 557:         return doms
Line 558: 
Line 559: 


-- 
To view, visit https://gerrit.ovirt.org/43225
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I5349ec51c7accf3b417b3bc9489c7eed5bfd8733
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Daniel Erez <derez at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list