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: