Change in vdsm[master]: vm: per-attribute monitor response check

nsoffer at redhat.com nsoffer at redhat.com
Wed Jan 22 10:45:30 UTC 2014


Nir Soffer has posted comments on this change.

Change subject: vm: per-attribute monitor response check
......................................................................


Patch Set 7: Code-Review-1

(2 comments)

I think this is too complicated, and I'm not worried about getting 2 message when switching from responsive or unresponsive state.

http://gerrit.ovirt.org/#/c/23138/7/vdsm/vm.py
File vdsm/vm.py:

Line 3671:                                      ' state%s',
Line 3672:                                      attrName,
Line 3673:                                      ': monitor is unresponsive' if wasEmpty
Line 3674:                                      else '')
Line 3675:                 self._attributeTimeouts.add(attrName)
Too complicated. How about:

    if attrName not in self._attributeTimeouts:
        self.log.warning("monitor unresponsive for %s", attrName)
    if not self._attributeTimeouts:
        self.log.warning("monitor became unresponsive")
    self._attributeTimeouts.add(attrName)
Line 3676:             elif attrName in self._attributeTimeouts:
Line 3677:                 self._attributeTimeouts.remove(attrName)
Line 3678:                 nowEmpty = len(self._attributeTimeouts) == 0
Line 3679:                 self.log.warning('attribute "%s" left unresponsive state%s',


Line 3678:                 nowEmpty = len(self._attributeTimeouts) == 0
Line 3679:                 self.log.warning('attribute "%s" left unresponsive state%s',
Line 3680:                                  attrName,
Line 3681:                                  ': monitor responsive again' if nowEmpty
Line 3682:                                  else '')
Too complicated. How about:

    self._attributeTimeouts.remove(attrName)
    self.log.warning("monitor is responsive for %s", attrName)
    if not self._attributeTimeouts:
        self.log.warning("monitor became responsive again")
Line 3683: 
Line 3684:     @property
Line 3685:     def monitorResponse(self):
Line 3686:         with self._attributeTimeoutsLock:


-- 
To view, visit http://gerrit.ovirt.org/23138
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I32a98d34cde91fa9dc3d07f03c47a5f2f22da620
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list