[NEW PATCH] BZ#726045 mask OSError in case domain sampling fails (via gerrit-bot)

Dan Kenigsberg danken at redhat.com
Thu Jul 28 10:39:58 UTC 2011


New patch submitted by Dan Kenigsberg (danken at redhat.com)

You can review this change at: http://gerrit.usersys.redhat.com/754

commit 0a4c1a43bc1210f05dd1efd0effa32ce5d840e1f
Author: Saggi Mizrahi <smizrahi at redhat.com>
Date:   Thu Jul 28 10:14:01 2011 +0300

    BZ#726045 mask OSError in case domain sampling fails
    
    Change-Id: Ic7a0bd47f8624a5f74930692b1a21a221e862804

diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 24722d6..8d2eebb 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -92,11 +92,9 @@ class StatsThread(threading.Thread):
     def run(self):
         while self._statsletrun:
             try:
-                delay = 0
                 if self._domain is None:
                     self._domain = SDF.produce(self._sdUUID)
                 stats, code = self._statsfunc(self._domain)
-                delay = self._domain.getReadDelay()
             except se.StorageException, e:
                 self.log.error("Unexpected error", exc_info=True)
                 code = e.code
@@ -104,6 +102,15 @@ class StatsThread(threading.Thread):
                 self.log.error("Unexpected error", exc_info=True)
                 code = 200
 
+            delay = 0
+            try:
+                # This is handled seperatly because in case of this kind
+                # of failure we don't want to print stack trace
+                delay = self._domain.getReadDelay()
+            except Exception, e:
+                self.log.error("Could not figure out delay for domain `%s` (%s)", self._sdUUID, e)
+                code = 200
+
             if code != 0:
                 self._domain = None
 




More information about the vdsm-patches mailing list