Dan Kenigsberg has posted comments on this change.
Change subject: libvirtconnection: ping libvirt upon disconnection
......................................................................
Patch Set 3: Code-Review-1
(3 comments)
reminder: -1 does not mean "I hate your patch". It means: "I read it, and
it is not completely ready".
Thanks for your patch!
....................................................
File lib/vdsm/libvirtconnection.py
Line 89: libvirt.VIR_ERR_INTERNAL_ERROR,
Line 90: libvirt.VIR_ERR_NO_CONNECT,
Line 91: libvirt.VIR_ERR_INVALID_CONN)
Line 92: if edom in EDOMAINS and ecode in ECODES:
Line 93: if not vdsmLibvirtPing:
the logic here is confusing. I'd expect that if the function is told to ping libvirt,
it would do it:
if pingLibvirt:
conn.getLibVersion()
(I think Saggi has alluded to this, too)
Line 94: conn.getLibVersion(vdsmLibvirtPing=True)
Line 95: else:
Line 96: log.error('connection to libvirt broken.'
Line 97: ' ecode: %d edom: %d', ecode, edom)
Line 90: libvirt.VIR_ERR_NO_CONNECT,
Line 91: libvirt.VIR_ERR_INVALID_CONN)
Line 92: if edom in EDOMAINS and ecode in ECODES:
Line 93: if not vdsmLibvirtPing:
Line 94: conn.getLibVersion(vdsmLibvirtPing=True)
Why should we not block? If getLibVersion() blocks (due to libvirt's sudden hang),
there is no reason to return a value. Libvirt could have hung a microsecond earlier, when
the wrapped method was called.
Line 95: else:
Line 96: log.error('connection to libvirt broken.'
Line 97: ' ecode: %d edom: %d', ecode, edom)
Line 98: if killOnFailure:
....................................................
File tests/libvirtconnectionTests.py
Line 1: #
Line 2: # Copyright 2012 Red Hat, Inc.
it's 2013
Line 3: #
Line 4: # This program is free software; you can redistribute it and/or modify
Line 5: # it under the terms of the GNU General Public License as published by
Line 6: # the Free Software Foundation; either version 2 of the License, or
--
To view, visit
http://gerrit.ovirt.org/19444
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia489e46dd8ce4c70c888988d17b86311d3c4b935
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes