Francesco Romani has posted comments on this change. Change subject: vm: improve safety between startup and shutdown ......................................................................
Patch Set 8: (1 comment) I don't want to push obfuscated changes. let me clean up this more. https://gerrit.ovirt.org/#/c/44989/8/vdsm/virt/vm.py File vdsm/virt/vm.py: Line 1765: self._created.set() Line 1766: Line 1767: def _domDependentInit(self): Line 1768: if self._destroyRequested.is_set(): Line 1769: raise DestroyedOnStartupError(vmexitreason.DESTROYED_ON_STARTUP) > What happens if destroy gets called after this check? Is there anything pre The key change here is the introduction of the "created" event. destroy() should go ahead only if the "created" event is set, so the checkpoint is reached -and the creation thread is done. This _is_ a bit extreme, but I can't see a better (= more efficient) way to make the flows safe with respect to each other. On the bright side, I don't expect this code to be triggered too often, destroy on startup is relatively infrequent AFAIK. So, the creation thread must be completed before the destroy can go ahead in a fully safe way, but this may take a while. Hence we need a timeout (implemented), and a shortcut. The shortcut is the 'destroyRequested' event. It has to be set as soon as possible, but _after_ the Domain object is created. Perhaps it is better to split this 'optimization' from the main change, it could make things clearer. Line 1770: Line 1771: if not self._dom.connected: Line 1772: raise MissingLibvirtDomainError(vmexitreason.LIBVIRT_START_FAILED) Line 1773: -- To view, visit https://gerrit.ovirt.org/44989 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8718f58f1d255d9e603db75aa1f256c03c300f3a Gerrit-PatchSet: 8 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani <from...@redhat.com> Gerrit-Reviewer: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com> Gerrit-Reviewer: Francesco Romani <from...@redhat.com> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Martin Polednik <mpoled...@redhat.com> Gerrit-Reviewer: Michal Skrivanek <mskri...@redhat.com> Gerrit-Reviewer: Milan Zamazal <mzama...@redhat.com> Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczew...@gmail.com> Gerrit-Reviewer: Vinzenz Feenstra <vfeen...@redhat.com> Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org> Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches