Browse Source

[711] reraise original exception when failed() fails in component.start()

see the code comment for the rationale.
JINMEI Tatuya 12 years ago
parent
commit
0b722ec0d7
1 changed files with 8 additions and 2 deletions
  1. 8 2
      src/lib/python/isc/bind10/component.py

+ 8 - 2
src/lib/python/isc/bind10/component.py

@@ -177,8 +177,14 @@ class BaseComponent:
             self._start_internal()
         except Exception as e:
             logger.error(BIND10_COMPONENT_START_EXCEPTION, self.name(), e)
-            self.failed(None)
-            raise
+            try:
+                self.failed(None)
+            finally:
+                # Even failed() can fail if this happens during initial startup
+                # time.  In that case we'd rather propagate the original reason
+                # for the failure than the fact that failed() failed.  So we
+                # always re-raise the original exception.
+                raise e
 
     def stop(self):
         """