Mark Wu has posted comments on this change.
Change subject: vdsm: Try to reconnect on vmchannel after timeout
......................................................................
Patch Set 2: I would prefer that you didn't submit this
(2 inline comments)
....................................................
File vdsm/guestIF.py
Line 102: ret = False
Line 103: try:
Line 104: self.log.debug("Attempting connection to %s",
self._socketName)
Line 105: result = self._sock.connect_ex(self._socketName)
Line 106: if result == 0:
According to python's documentation, it returns an error instead of throwing an
exception:
socket.connect_ex(address)
Like connect(address), but return an error indicator instead of raising an
exception for errors returned by the C-level connect() call (other problems,
such as “host not found,” can still raise exceptions). The error indicator is 0
if the operation succeeded, otherwise the value of the errno variable.
Line 107: self.log.debug("Connected to %s", self._socketName)
Line 108: self._messageState = MessageState.NORMAL
Line 109: self._clearReadBuffer()
Line 110: self._forward('refresh')
Line 272: if self.guestStatus not in ("Powered down",
"RebootInProgress"):
Line 273: self.log.log(logging.TRACE, "Guest connection timed out")
Line 274: self.guestStatus = None
Line 275: self.log.debug("Attempting to reconnect to channel after
timeout")
Line 276: self._connect()
I agree with that we should put this logic in VmChannles. I just have one
question. Should we differentiate the case of no guest agent available on guest
and disconnection occasionally. It doesn't make sense to keep trying to
reconnect to guest agent if it's not running it guest.
Line 277:
Line 278: def _clearReadBuffer(self):
Line 279: self._buffer = []
Line 280: self._bufferSize = 0
--
To view, visit http://gerrit.ovirt.org/11977
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I8b9b9418e39558d45c97e9545bc9ecc4935f004e
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Gal Hammer <[email protected]>
Gerrit-Reviewer: Igor Lvovsky <[email protected]>
Gerrit-Reviewer: Mark Wu <[email protected]>
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Peter V. Saveliev <[email protected]>
Gerrit-Reviewer: Vinzenz Feenstra <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches